Actions
Idea #3898
closed[API] Job model has a single state attribute that can be updated and read instead of paying attention to running and success flags.
Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
-
Target version:
Start date:
09/19/2014
Due date:
Story points:
0.5
Description
Before validation:
Translating from state to running/success:
- If state has changed to Running, set started_at to now
- If state has changed to Failed or Complete, set finished_at to now
- If state has changed to Cancelled, set cancelled_at to now
- If state has changed at all, set running and success (see below)
- If state has not changed, and any of {running, success, cancelled_at} have changed, update state accordingly
- If state is nil, update state according to running, success, cancelled_at
- If state has changed to Running, and is_locked_by_uuid is nil, return false
running | success | cancelled_at | state |
any | any | not nil | Cancelled |
any | false | nil | Failed |
any | true | nil | Complete |
true | nil | nil | Running |
false | nil | nil | Queued |
state | running | success |
Queued | false | nil |
Running | true | nil |
Cancelled | false | false |
Failed | false | false |
Complete | false | true |
Actions