Skip to content

Commit

Permalink
Improve backend schedule logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMuellerDev committed Sep 11, 2022
1 parent 33078d0 commit fb736d3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/scheduler/scheduler/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ func scheduleRunnerFunc(id uint) {
return
}
if !found {
log.Warn("Schedule failed because owner user does not exist anymore, deleting schedule...")
if err := database.DeleteScheduleById(id); err != nil {
log.Error("Cleaning up dangling schedule failed: could not remove schedule from database: ", err.Error())
return
}
log.Warn("Schedule failed because owner user does not exist anymore, skipping execution...")
return
}
if !owner.SchedulerEnabled {
log.Debug(fmt.Sprintf("Schedule '%s' was not executed because its owner has disabled their schedules & automations", job.Data.Name))
Expand All @@ -69,7 +66,7 @@ func scheduleRunnerFunc(id uint) {
)
return
}
log.Debug(fmt.Sprintf("Schedule '%d' is executing its target", id))
log.Debug(fmt.Sprintf("Schedule '%s' (%d) is executing...", job.Data.Name, id))
switch job.Data.TargetMode {
case database.ScheduleTargetModeCode:
_, _, _, hmsErrors := homescript.HmsManager.Run(
Expand Down

0 comments on commit fb736d3

Please sign in to comment.