rename daemon to backend in code

This commit is contained in:
Oliver Gorwits
2017-05-06 16:26:43 +01:00
parent ffe8fc180f
commit 86a605ba68
11 changed files with 69 additions and 66 deletions

View File

@@ -1,9 +1,9 @@
package App::Netdisco::Daemon::Worker::Scheduler;
package App::Netdisco::Backend::Worker::Scheduler;
use Dancer qw/:moose :syntax :script/;
use Algorithm::Cron;
use App::Netdisco::Util::Daemon;
use App::Netdisco::Util::Backend;
use Role::Tiny;
use namespace::clean;
@@ -39,7 +39,7 @@ sub worker_body {
my $wid = $self->wid;
unless (setting('schedule')) {
prctl sprintf 'netdisco-daemon: worker #%s scheduler: inactive', $wid;
prctl sprintf 'netdisco-backend: worker #%s scheduler: inactive', $wid;
return debug "sch ($wid): no need for scheduler... quitting"
}
@@ -47,11 +47,11 @@ sub worker_body {
# sleep until some point in the next minute
my $naptime = 60 - (time % 60) + int(rand(45));
prctl sprintf 'netdisco-daemon: worker #%s scheduler: idle', $wid;
prctl sprintf 'netdisco-backend: worker #%s scheduler: idle', $wid;
debug "sched ($wid): sleeping for $naptime seconds";
sleep $naptime;
prctl sprintf 'netdisco-daemon: worker #%s scheduler: queueing', $wid;
prctl sprintf 'netdisco-backend: worker #%s scheduler: queueing', $wid;
# NB next_time() returns the next *after* win_start
my $win_start = time - (time % 60) - 1;