From de6fdee0e4ad5b9b596bafb3fc7902125bebcff2 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Mon, 15 Apr 2024 14:01:36 +1000 Subject: [PATCH] fix lint --- backend/controller/cronjobs/cronjobs.go | 3 ++- backend/controller/dal/dal.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/controller/cronjobs/cronjobs.go b/backend/controller/cronjobs/cronjobs.go index 4664e7ebfd..1b9a87793f 100644 --- a/backend/controller/cronjobs/cronjobs.go +++ b/backend/controller/cronjobs/cronjobs.go @@ -159,7 +159,8 @@ func (s *Service) NewCronJobsForModule(ctx context.Context, module *schemapb.Mod return newJobs, nil } -// CreatedOrReplacedDeloyment: When a controller creates/replaces a deployment, its cron job service is responsible for +// CreatedOrReplacedDeloyment is only called by the responsible controller to its cron service, and will not be received by the other cron services. +// When a controller creates/replaces a deployment, its cron job service is responsible for // the newly created cron jobs until other controllers have a chance to resync their list of jobs and start sharing responsibility of the new cron jobs. func (s *Service) CreatedOrReplacedDeloyment(ctx context.Context, newDeploymentKey model.DeploymentKey) { // Rather than finding old/new cron jobs and updating our state, we can just resync the list of jobs diff --git a/backend/controller/dal/dal.go b/backend/controller/dal/dal.go index 79ec976132..3ae62cfeb3 100644 --- a/backend/controller/dal/dal.go +++ b/backend/controller/dal/dal.go @@ -924,7 +924,7 @@ func cronJobFromRow(row sql.GetCronJobsRow) model.CronJob { Schedule: row.Schedule, StartTime: row.StartTime, NextExecution: row.NextExecution, - State: model.CronJobState(row.State), + State: row.State, } } @@ -963,7 +963,7 @@ func (d *DAL) StartCronJobs(ctx context.Context, jobs []model.CronJob) (attempte Schedule: row.Schedule, StartTime: row.StartTime, NextExecution: row.NextExecution, - State: model.CronJobState(row.State), + State: row.State, }, DidStartExecution: row.Updated, HasMinReplicas: row.HasMinReplicas,