scheduler: log details when starting scheduler (#2459)

pull/2461/head
Louis Ruch 3 years ago committed by GitHub
parent e588623ebd
commit c73a13aa3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -184,12 +184,17 @@ func (s *Scheduler) RunNow() {
func (s *Scheduler) start(ctx context.Context) {
const op = "scheduler.(Scheduler).start"
event.WriteSysEvent(ctx, op, "scheduling loop running",
"server id", s.serverId,
"run interval", s.runJobsInterval.String(),
"run limit", s.runJobsLimit)
timer := time.NewTimer(0)
var wg sync.WaitGroup
for {
select {
case <-ctx.Done():
event.WriteSysEvent(ctx, op, "scheduling loop received shutdown, waiting for jobs to finish", "server id", s.serverId)
event.WriteSysEvent(ctx, op, "scheduling loop received shutdown, waiting for jobs to finish",
"server id", s.serverId)
wg.Wait()
event.WriteSysEvent(ctx, op, "scheduling loop shutting down", "server id", s.serverId)
return
@ -282,6 +287,10 @@ func (s *Scheduler) runJob(ctx context.Context, wg *sync.WaitGroup, r *job.Run)
func (s *Scheduler) monitorJobs(ctx context.Context) {
const op = "scheduler.(Scheduler).monitorJobs"
event.WriteSysEvent(ctx, op, "monitor loop running",
"server id", s.serverId,
"monitor interval", s.monitorInterval.String(),
"interrupt threshold", s.interruptThreshold.String())
timer := time.NewTimer(0)
for {
select {

Loading…
Cancel
Save