Skip to content

Commit 2cd379e

Browse files
committed
chore: lint fix
1 parent 87eb27f commit 2cd379e

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
@@ -145,9 +145,7 @@ func PersistNotificationFromCRD(ctx context.Context, obj *v1.Notification) error
145145
return err
146146
}
147147

148-
notification.SyncWatchdogJob(ctx, jobs.FuncScheduler, string(obj.GetUID()), obj.Spec.WatchdogInterval)
149-
150-
return nil
148+
return notification.SyncWatchdogJob(ctx, jobs.FuncScheduler, string(obj.GetUID()), obj.Spec.WatchdogInterval)
151149
}
152150

153151
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)