Fixes up some abstraction so that we can add other jobs backends and
specs, migrations, etc will work as expected.
Also remove some unused parameters from the Delayed::Job methods for
finding and locking jobs.
test plan: run the database migrations on a new db, and migrations
should work without error. delayed jobs should also be created and
processed by workers without error.
Change-Id: I1fe6ef5464f9780db3010fa002703fc030832f8d
Reviewed-on: https://gerrit.instructure.com/11590
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
To simplify the queries done on jobs:
* failed jobs now go in a separate table
* jobs that go past their max_run_time don't immediately get re-run.
instead a periodic job goes through every 5 minutes and unlocks
expired jobs
* strand performance is much improved
* we filter out jobs that can't be run because of strand
restrictions completely in the database query now
* better indexes help with these queries and the sub-select
Change-Id: Ida494da2fcec409bff330b7676c9a6b9413b3a06
Reviewed-on: https://gerrit.instructure.com/4163
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>