Skip to content

Worker with embeded WorkerDefaults does not implement Worker interface #562

Closed

Description

@taras-turchenko-moc

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

Activity

  1. changed the title [-]Worker with embeded WorkerDefaults doen not implement Worker interface[/-] [+]Worker with embeded WorkerDefaults does not implement Worker interface[/+] on Aug 24, 2024
  2. locked and limited conversation to collaborators on Aug 24, 2024
  3. converted this issue into a discussion #563 on Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions