Skip to content

Commit 1d59e19

Browse files
committed
chore: lint fix
1 parent ed69e7f commit 1d59e19

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/server.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ func PersistNotificationFromCRD(ctx context.Context, obj *v1.Notification) error
123123
return err
124124
}
125125

126-
notification.SyncWatchdogJob(ctx, jobs.FuncScheduler, string(obj.GetUID()), obj.Spec.WatchdogInterval)
127-
128-
return nil
126+
return notification.SyncWatchdogJob(ctx, jobs.FuncScheduler, string(obj.GetUID()), obj.Spec.WatchdogInterval)
129127
}
130128

131129
var Serve = &cobra.Command{

notification/job.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,9 @@ func SyncWatchdogJob(ctx context.Context, scheduler *cron.Cron, notificationID s
532532
func scheduleWatchdogJob(ctx context.Context, scheduler *cron.Cron, notificationID string, interval string) error {
533533
ctx.Debugf("scheduling watchdog job for %s with interval %s", notificationID, interval)
534534
job := WatchdogNotificationJob(ctx, notificationID, interval)
535-
job.AddToScheduler(scheduler)
535+
if err := job.AddToScheduler(scheduler); err != nil {
536+
return fmt.Errorf("failed to add watchdog job to scheduler: %w", err)
537+
}
536538
watchdogJobs.Store(notificationID, job)
537539
return nil
538540
}

0 commit comments

Comments
 (0)