amitree / delayed_job_recurring

Extends delayed_job to support recurring jobs
MIT License
84 stars 33 forks source link

Scheduling multiple jobs of same class #18

Closed Gokul595 closed 7 years ago

Gokul595 commented 7 years ago

In reference to issue #17,

Added option to schedule multiple jobs with same class by differentiating with an unique param job_matching_param.

To schedule multiple jobs with same class, pass an unique matching param job_matching_param and value for that matching param in each job as below:

MyTask.schedule(run_at: '12:00', job_matching_param: 'schedule_id', schedule_id: 2)

This allows you to schedule multiple jobs with same class if value of the unique matching param(which is schedule_id in above example) is different in each job.

Gokul595 commented 7 years ago

@afn Updated pull request with replacing options with @scheduled_options variable