#296 Fix occasional empty macsuck when run in daemon

This commit is contained in:
Oliver Gorwits
2017-02-27 14:39:09 +00:00
parent b449558e8b
commit 724ff68946
2 changed files with 5 additions and 9 deletions

View File

@@ -40,15 +40,7 @@ sub worker_body {
};
$self->close_job($job);
# restart worker once a day.
my $hour = [localtime()]->[2];
if ($wid) {
if ((time >= ($self->{started} + 86400) and $hour == ($wid % 24))
or (time > ($self->{started} + 172800))) {
$self->exit(0, "recycling worker $wid");
}
}
$self->exit(0); # recycle worker
}
}