about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-06-24 00:00:04 +0000
committerEric Wong <e@80x24.org>2017-06-26 03:07:46 +0000
commit5bde05b66f084c7c9dcf7389079aab6925aef328 (patch)
treecdf20cac4e189fc373116b0270e9f5f3f5b6edcf /script
parent23d896234f3eb5e579de2e8ddf3c723654862ade (diff)
downloadpublic-inbox-5bde05b66f084c7c9dcf7389079aab6925aef328.tar.gz
Otherwise the old watcher may run indefinitely
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-watch3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/public-inbox-watch b/script/public-inbox-watch
index bb655929..a72180c9 100755
--- a/script/public-inbox-watch
+++ b/script/public-inbox-watch
@@ -8,6 +8,7 @@ use PublicInbox::Config;
 my ($config, $watch_md);
 my $reload = sub {
         $config = PublicInbox::Config->new;
+        $watch_md->quit if $watch_md;
         $watch_md = PublicInbox::WatchMaildir->new($config);
 };
 $reload->();
@@ -17,5 +18,5 @@ if ($watch_md) {
         $SIG{USR1} = $scan;
         $SIG{ALRM} = sub { $SIG{ALRM} = 'DEFAULT'; $scan->() };
         alarm(1);
-        $watch_md->watch;
+        $watch_md->watch while ($watch_md);
 }