Skip to content
Snippets Groups Projects
Commit bf8cb760 authored by Christian Pointner's avatar Christian Pointner
Browse files

fix race between store import state being updated after running channel is closed

parent ba00d48e
No related branches found
No related tags found
No related merge requests found
......@@ -77,10 +77,10 @@ func (job *Job) run() error {
// job.Cancel() only set the state to JobCanceled... so we simulate a canceled context here
return context.Canceled
}
close(job.subC.running)
job.StartedAt.set(time.Now())
job.im.dbgLog.Printf("running import for %s/%d from: %s", job.Group, job.ID, job.Source.String())
job.im.store.UpdateFileImportState(job.Group, job.ID, store.ImportRunning)
close(job.subC.running)
if err := job.initializeSource(); err != nil {
job.im.store.UpdateFileImportState(job.Group, job.ID, store.ImportAborted)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment