Skip to content

MaxAttempts not being used in InsertOpts #412

Closed Answered by brandur
Zibbp asked this question in Q&A
Discussion options

You must be logged in to vote

Can you try giving InsertOpts a non-pointer receiver and see if that fixes it?

func (w WatchdogArgs) InsertOpts() river.InsertOpts {
	return river.InsertOpts{
		MaxAttempts: 1,
		Queue:       "default",
	}
}

(See the (w WatchdogArgs) part where I removed the pointer.)

It may be that since a non-pointer implements the JobArgs interface (you have func (WatchdogArgs) Kind()), then you also need a non-pointer to implement JobArgsWithInsertOpts which is what extracts an InsertOpts.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Zibbp
Comment options

Answer selected by Zibbp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants