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?
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:
Because of this condition, internal
client.periodicJobswill not be initialized, which leads to panic when trying to insert a periodic job:Is this behavior intentional, or is it a bug?