Ney
Ney

Reputation: 441

Access enqueued_at from Sidekiq worker

Is there a way to get the Sidekick job object from a worker in order to access its enqueued_at attribute? I wanna create records using the enqueued_at timestamp in the created_at/updated_at fields for a Sidekiq queue that's been paused for a long time (and in case I pause it again).

Upvotes: 3

Views: 1063

Answers (1)

Mike Perham
Mike Perham

Reputation: 22208

You can only access job metadata from middleware. If your worker needs data, it must be passed as arguments to the worker.

Upvotes: 4

Related Questions