restart worker after two days if splay restart did not trigger
This commit is contained in:
@@ -42,13 +42,14 @@ sub worker_body {
|
|||||||
$self->close_job($job);
|
$self->close_job($job);
|
||||||
|
|
||||||
# restart worker once a day.
|
# restart worker once a day.
|
||||||
# relies on the worker seeing a job at least every hour.
|
|
||||||
my $hour = [localtime()]->[2];
|
my $hour = [localtime()]->[2];
|
||||||
if ($wid and (time >= ($self->{started} + 86400))
|
if ($wid) {
|
||||||
and ($hour == ($wid % 24))) {
|
if ((time >= ($self->{started} + 86400) and $hour == ($wid % 24))
|
||||||
|
or (time > ($self->{started} + 172800))) {
|
||||||
$self->exit(0, "recycling worker $wid");
|
$self->exit(0, "recycling worker $wid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub close_job {
|
sub close_job {
|
||||||
|
|||||||
Reference in New Issue
Block a user