From ffb27000431f744f2cec9d198d0a0d8cbb0bd405 Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 21 Nov 2006 17:47:53 +0000 Subject: * Add a test suite for the mercurial backend, contributed by Emanuele Aina. * Add a test suite for the svn backend. * Daemonize before sending RPC pings, since that can take a while and/or hang. * Daemonize before sending commit mails, as that can also take a long time/hang if the mail server is unhappy. * Factor out commit mail sending code into new function. --- IkiWiki/Plugin/inline.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index c6c6c6a1e..e65b8ae71 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -342,7 +342,15 @@ sub pingurl (@) { #{{{ return; } - # TODO: daemonize here so slow pings don't slow down wiki updates + # daemonize here so slow pings don't slow down wiki updates + eval q{use POSIX ’setsid’}; + chdir '/'; + open STDIN, '/dev/null'; + open STDOUT, '>/dev/null'; + defined(my $pid = fork) or error("Can't fork: $!"); + return if $pid; + setsid() or error("Can't start a new session: $!"); + open STDERR, '>&STDOUT' or error("Can’t dup stdout: $!"); foreach my $page (keys %toping) { my $title=pagetitle(basename($page)); -- cgit v1.2.3