lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

How to provide Unique Key to a Job? #106

Closed marcelinhov2 closed 6 years ago

marcelinhov2 commented 6 years ago

At the docs, you make mention of define an unique key for a Job, but I can not do it and idk why. =/

masitko commented 6 years ago

Just add unique method with name of the job like in the example: var job = Queue .createJob('unique_every', { timezone: 'Europe/Amsterdam' }) .priority('normal') .unique('unique_every');

lykmapipo commented 6 years ago

@marcelinhov2

@masitko point it out clearly. You should use .unique(<tag|unique value>); to provide unique key to a job.

Please ensure its unique across your clusters or deployment instances to support concurrent workers.

Thanks.