riverqueue / river

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

Middleware for Periodic Jobs (Tracing) #675

Closed mfrister closed 1 week ago

mfrister commented 2 weeks ago

While adding tracing, I've noticed that periodic jobs are inserted without going through middleware configured on the Client - it looks like PeriodicJobEnqueuer's insertBatch goes directly to the River driver instead of going through the client.

For completeness of the trace (job may be scheduled earlier than actually run if workers are busy), it would be nice to be able to intercept periodic job insertion in middleware.

bgentry commented 1 week ago

@mfrister Thanks for catching this! I'll have a v0.14.2 out shortly with this fix from #679 in it. :v: