A job is now in "WAITING" state exactly when it is in the channel, once it is popped it enters "RUNNING" state. It is only possible to update the state of a job that is in the running state. This mean that updating to "RUNNING" is entirely optional, but in the future we may want to use this as a watchdog logic, and require the worker to update at regular intervals to avoid being restarted. The job queue API is updated to require a POST followed by one or several PATCH messages to the returned ID. If a patch is sent to an ID before the POST it is as if the object does not exist (regarldess of it being in the queue in WAITING state or not). Once a job has been POSTed it can be PATCHed to update it zero or more times with (still) RUNNING before exactly oncee with either FINISHED or FAILED. Signed-off-by: Tom Gundersen <teg@jklm.no> |
||
|---|---|---|
| .. | ||
| api.go | ||
| api_test.go | ||