lykmapipo / kue-scheduler

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

Running scheduler thru multiple PM2 processes. #76

Closed reebayroo closed 7 years ago

reebayroo commented 7 years ago

Hello all, I have a problem with running kue-scheduler in a multi process environment with PM2. I end up kicking a cron event as many times as the processes I have running.

Is there a way to restrict the execution to one single PM2 process?

Thanks in advance.

mmarshak commented 7 years ago

I have the same issue, it is not design as of now to handle multi server environment with the every option. You should use schedule and reschedule to the next time slot.

lykmapipo commented 7 years ago

@reebayroo see v0.7.0 release and try to use worker options. Default is true and your process will process jobs if otherwise if you set to false you will have each process have its own duties i.e either scheduler or worker