Skip to content

Unable to insert a periodic job from external service #937

Description

@odyfey

During the implementation of enqueuing a periodic job from external service, a panic occurred. The external service does not contain any code for registering workers, it stores data and passes it to the worker as parameters when enqueuing periodic jobs.

How to reproduce

Initialize in an external service a client without worker registration:

client, err := river.NewClient(riverpgxv5.New(workerPool), &river.Config{})

Because of this condition, internal client.periodicJobs will not be initialized, which leads to panic when trying to insert a periodic job:

client.PeriodicJobs().Add(j)

Is this behavior intentional, or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions