summaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2018-06-30 12:24:04 -0400
committerJoramWilander <jwawilander@gmail.com>2018-06-30 12:24:04 -0400
commit3848cb7e79e019e2f0878d6e2377ad36b3c7ca43 (patch)
tree98beeb962ffc6d7c3f8cd38651eaccab4a9685fa /migrations
parent88c5e469ca869d9e8ceadb0f2b03e86005102f24 (diff)
parent2362a5b7f7c2b4bf2b35b104e8616d847b33b0be (diff)
downloadchat-3848cb7e79e019e2f0878d6e2377ad36b3c7ca43.tar.gz
chat-3848cb7e79e019e2f0878d6e2377ad36b3c7ca43.tar.bz2
chat-3848cb7e79e019e2f0878d6e2377ad36b3c7ca43.zip
Merge branch 'master' into plugins-2
Diffstat (limited to 'migrations')
-rw-r--r--migrations/scheduler.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/migrations/scheduler.go b/migrations/scheduler.go
index 8a7ac30d0..5778c5cb3 100644
--- a/migrations/scheduler.go
+++ b/migrations/scheduler.go
@@ -59,7 +59,7 @@ func (scheduler *Scheduler) ScheduleJob(cfg *model.Config, pendingJobs bool, las
if state == MIGRATION_STATE_IN_PROGRESS {
// Check the migration job isn't wedged.
- if job != nil && job.LastActivityAt < model.GetMillis()-MIGRATION_JOB_WEDGED_TIMEOUT_MILLISECONDS {
+ if job != nil && job.LastActivityAt < model.GetMillis()-MIGRATION_JOB_WEDGED_TIMEOUT_MILLISECONDS && job.CreateAt < model.GetMillis()-MIGRATION_JOB_WEDGED_TIMEOUT_MILLISECONDS {
mlog.Warn("Job appears to be wedged. Rescheduling another instance.", mlog.String("scheduler", scheduler.Name()), mlog.String("wedged_job_id", job.Id), mlog.String("migration_key", key))
if err := scheduler.App.Jobs.SetJobError(job, nil); err != nil {
mlog.Error("Worker: Failed to set job error", mlog.String("scheduler", scheduler.Name()), mlog.String("job_id", job.Id), mlog.String("error", err.Error()))