riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
2.86k stars 68 forks source link

fix: use the constructor function every time a periodic job is scheduled, instead of when its registered #420

Closed elee1766 closed 1 week ago

elee1766 commented 1 week ago

right now, the constructor gets called when converting to an internal job, which causes the constructor to use the value at add time.

however, the comments say

// The constructor function is invoked each time a periodic job's schedule
// elapses, returning job arguments to insert along with optional insertion
// options.

so im assuming this is whats intended?

brandur commented 1 week ago

Oops, yes, thanks! I'll try to add a test case to verify this.