humanmade / Cavalcade-Runner

Daemon for Cavalcade, a scalable WordPress jobs system.
https://engineering.hmn.md/projects/cavalcade/
53 stars 26 forks source link

Lock a job when starting it #41

Closed joehoyle closed 6 years ago

joehoyle commented 6 years ago

Right now we are seeing jobs being run more than once simultaneously because a job's "lock" is not quite atomic. We should probably use a SELECT... FOR UPDATE in https://github.com/humanmade/Cavalcade-Runner/blob/master/inc/class-runner.php#L221

rmccue commented 6 years ago

This should already be handled?

joehoyle commented 6 years ago

Yeah, not sure how I didn't see that