#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

@@ -4,6 +4,10 @@
* #27 add SNMP tips for Huawei, CloudEngine, Linksys (stoatwblr) * #27 add SNMP tips for Huawei, CloudEngine, Linksys (stoatwblr)
[BUG FIXES]
* #296 Fix occasional empty macsuck when run in daemon
2.034002 - 2017-01-06 2.034002 - 2017-01-06
[ENHANCEMENTS] [ENHANCEMENTS]

View File

@@ -40,15 +40,7 @@ sub worker_body {
}; };
$self->close_job($job); $self->close_job($job);
$self->exit(0); # recycle worker
# 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");
}
}
} }
} }