mirror of
https://github.com/stashapp/stash.git
synced 2026-04-19 13:31:15 +02:00
Fix handling of immediately started jobs
This commit is contained in:
parent
56bfc43118
commit
50bef583ac
1 changed files with 12 additions and 1 deletions
|
|
@ -95,7 +95,18 @@ func (m *Manager) Start(ctx context.Context, description string, e JobExec) int
|
|||
|
||||
m.queue = append(m.queue, &j)
|
||||
|
||||
m.dispatch(ctx, &j)
|
||||
m.notifyNewJob(&j)
|
||||
done := m.dispatch(ctx, &j)
|
||||
|
||||
// handle removing the job from the queue when it is done
|
||||
go func() {
|
||||
<-done
|
||||
m.mutex.Lock()
|
||||
defer m.mutex.Unlock()
|
||||
|
||||
// remove the job from the queue
|
||||
m.removeJob(&j)
|
||||
}()
|
||||
|
||||
return j.ID
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue