riverqueue/river

Worker with embeded WorkerDefaults does not implement Worker interface

taras-turchenko-moc opened this issue · 0 comments

Hi guys. I have an issue with river.AddWorker to add an worker. I have added river.WorkerDefaults[WorkerArgs] but it still fails on interface check

Cannot use deleteimages.NewWorker() (type *Worker) as the type Worker[T] Type does not implement Worker[T]
need the method: NextRetry(job *Job[T]) time.Time
have the method: NextRetry(*Job[T]) time.Time

Manually specifying NextRetry method fixes the issue

func (w *Worker) NextRetry(_ *river.Job[WorkerArgs]) time.Time {
  return time.Time{}
}

output of go version

go version go1.22.6 linux/arm64