Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in how repeatable jobs keys are stored on redis #1018

Closed
alietors opened this issue Jan 25, 2022 · 2 comments
Closed

Change in how repeatable jobs keys are stored on redis #1018

alietors opened this issue Jan 25, 2022 · 2 comments

Comments

@alietors
Copy link

Hi,

We have been using bullmq for a long time, on prod we use v1.14.7.

We have an scheduler service that add jobs to queues like this
queue.add('my-queue-prefix-queue|job|job-id', data, { jobId: 'job-id', repeat: { tz: "utc", cron } })

That code uses to produce an entry on redis like
bull:my-queue-prefix-queue:repeat:my-queue-prefix-queue|job|job-id:1643110680000

The format was bull:QUEUE: repeat :NAME_OF_JOB:NEXT_TIME

But now, for some reason the key added to redis is
bull:my-queue-prefix-queue:repeat:a2cde7ea09c1e55202b3035390da2bac:1643110680000

Instead of using the name I provided when adding the job to the queue it show a string that I'm not quite sure what it is but it is preventing us to find the key.

Any idea about what is that? When we use the getRepeatableJobs that id does not come with it.

Thanks!

@manast
Copy link
Contributor

manast commented Jan 25, 2022

I cannot remember right now the reason for the change in the format, but the string in question is the md5 sum of the "repeat job key", so I think a md5("repeat:my-queue-prefix-queue|job|job-id") would give you that number.

function md5(str: string) {
  return createHash('md5').update(str).digest('hex');
}

Let me know if this is of any help.

@alietors
Copy link
Author

Hi! Thanks for the reply!

It was a md5 hash but the string was a bit more convoluted.
Looking into the code https://github.com/taskforcesh/bullmq/blob/master/src/classes/repeat.ts I got all the pieces to generate the md5.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants