riverqueue / river

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

change default retry count #381

Closed elee1766 closed 1 month ago

elee1766 commented 1 month ago

I can't seem to find an easy way to configure the max attempts for a client.

from what i see, i can only configure it on the args or insert level, and then it is the hard coded 25.

https://github.com/riverqueue/river/blob/master/client.go#L1255

It would be nice if this could be customizable somehow through the clients config, either through configuring the said 25 number, or some sort of insertOpts middleware, so that i could set the default job to have 1 max attempt, and not have to configure the majority of my jobs to have 1 max attempt.

bgentry commented 1 month ago

@elee1766 there was no way to customize the default value globally (it was always MaxAttemptsDefault of 25). I opened #383 to add this.