diff options
author | George Goldberg <george@gberg.me> | 2018-05-14 15:59:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 15:59:04 +0100 |
commit | 51bd710ecdca6628461c9fa2679737073e4d5059 (patch) | |
tree | b2a4837ced3ed515ee505728917a6630b0553f76 /jobs/jobs.go | |
parent | 91557bbd978500388a11b99401783164e143a966 (diff) | |
download | chat-51bd710ecdca6628461c9fa2679737073e4d5059.tar.gz chat-51bd710ecdca6628461c9fa2679737073e4d5059.tar.bz2 chat-51bd710ecdca6628461c9fa2679737073e4d5059.zip |
MM-9728: Online migration for advanced permissions phase 2 (#8744)
* MM-9728: Online migration for advanced permissions phase 2
* Add unit tests for new store functions.
* Move migration specific code to own file.
* Add migration state function test.
* Style fixes.
* Add i18n strings.
* Fix mocks.
* Add TestMain to migrations package tests.
* Fix typo.
* Fix review comments.
* Fix up the "Check if migration is done" check to actually work.
Diffstat (limited to 'jobs/jobs.go')
-rw-r--r-- | jobs/jobs.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jobs/jobs.go b/jobs/jobs.go index 850491403..ddbc4489b 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -106,6 +106,13 @@ func (srv *JobServer) SetJobCanceled(job *model.Job) *model.AppError { return result.Err } +func (srv *JobServer) UpdateInProgressJobData(job *model.Job) *model.AppError { + job.Status = model.JOB_STATUS_IN_PROGRESS + job.LastActivityAt = model.GetMillis() + result := <-srv.Store.Job().UpdateOptimistically(job, model.JOB_STATUS_IN_PROGRESS) + return result.Err +} + func (srv *JobServer) RequestCancellation(jobId string) *model.AppError { if result := <-srv.Store.Job().UpdateStatusOptimistically(jobId, model.JOB_STATUS_PENDING, model.JOB_STATUS_CANCELED); result.Err != nil { return result.Err |