Skip to content

Commit

Permalink
fix: use the constructor function every time a periodic job is schedu…
Browse files Browse the repository at this point in the history
…led, instead of when its registered (#420)
  • Loading branch information
elee1766 authored Jul 4, 2024
1 parent cfe1b10 commit d5b5960
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions periodic_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,9 @@ func (b *PeriodicJobBundle) toInternal(periodicJob *PeriodicJob) *maintenance.Pe
if periodicJob.opts != nil {
opts = periodicJob.opts
}
args, options := periodicJob.constructorFunc()

return &maintenance.PeriodicJob{
ConstructorFunc: func() (*riverdriver.JobInsertFastParams, *dbunique.UniqueOpts, error) {
args, options := periodicJob.constructorFunc()
return insertParamsFromConfigArgsAndOptions(&b.periodicJobEnqueuer.Archetype, b.clientConfig, args, options)
},
RunOnStart: opts.RunOnStart,
Expand Down

0 comments on commit d5b5960

Please sign in to comment.