X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b144831e462e0d2ba8225f6e5f7d9138efb03c77..52bbdbb1a5ce994c9afac253c1d9bfd94acf4d1d:/IkiWiki/Plugin/pinger.pm diff --git a/IkiWiki/Plugin/pinger.pm b/IkiWiki/Plugin/pinger.pm index c6fa76e3f..0aee17f8a 100644 --- a/IkiWiki/Plugin/pinger.pm +++ b/IkiWiki/Plugin/pinger.pm @@ -9,12 +9,24 @@ my %pages; my $pinged=0; sub import { #{{{ + hook(type => "getsetup", id => "pinger", call => \&getsetup); hook(type => "needsbuild", id => "pinger", call => \&needsbuild); hook(type => "preprocess", id => "ping", call => \&preprocess); hook(type => "delete", id => "pinger", call => \&ping); hook(type => "change", id => "pinger", call => \&ping); } # }}} +sub getsetup () { #{{{ + return + pinger_timeout => { + type => "integer", + default => 15, + description => "how many seconds to try pinging before timing out", + safe => 1, + rebuild => 0, + }, +} #}}} + sub needsbuild (@) { #{{{ my $needsbuild=shift; foreach my $page (keys %pagestate) { @@ -34,7 +46,7 @@ sub needsbuild (@) { #{{{ sub preprocess (@) { #{{{ my %params=@_; if (! exists $params{from} || ! exists $params{to}) { - return "[[ping ".gettext("requires 'from' and 'to' parameters")."]]"; + error gettext("requires 'from' and 'to' parameters"); } if ($params{from} eq $config{url}) { $pagestate{$params{destpage}}{pinger}{$params{to}}=1;