forked from forgejo/forgejo
move unlocking out of setInternal
This commit is contained in:
parent
e852cb620f
commit
21b9778119
2 changed files with 23 additions and 8 deletions
|
@ -122,7 +122,12 @@ func (p *PersistableChannelQueue) Push(data Data) error {
|
|||
func (p *PersistableChannelQueue) Run(atShutdown, atTerminate func(context.Context, func())) {
|
||||
p.lock.Lock()
|
||||
if p.internal == nil {
|
||||
p.setInternal(atShutdown, p.ChannelQueue.pool.handle, p.exemplar)
|
||||
err := p.setInternal(atShutdown, p.ChannelQueue.pool.handle, p.exemplar)
|
||||
p.lock.Unlock()
|
||||
if err != nil {
|
||||
log.Fatal("Unable to create internal queue for %s Error: %v", p.Name(), err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
p.lock.Unlock()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue