fix_: keep community locks map unreleased when Manager stops
`ReevaluateMembers` is run as a separate goroutine and sometimes it is executed after `Manager` has been stopped. It tries to use the lock and in consequence, it panics. Ensuring the map is still there prevents that. ^Happened in test: `TestCreateTokenPermission`.
This commit is contained in:
parent
9d309886f7
commit
bd91f5ab49
|
@ -150,10 +150,6 @@ func (c *CommunityLock) Init() {
|
||||||
c.locks = make(map[string]*sync.Mutex)
|
c.locks = make(map[string]*sync.Mutex)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CommunityLock) Release() {
|
|
||||||
c.locks = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type HistoryArchiveDownloadTask struct {
|
type HistoryArchiveDownloadTask struct {
|
||||||
CancelChan chan struct{}
|
CancelChan chan struct{}
|
||||||
Waiter sync.WaitGroup
|
Waiter sync.WaitGroup
|
||||||
|
@ -579,7 +575,6 @@ func (m *Manager) Stop() error {
|
||||||
close(c)
|
close(c)
|
||||||
}
|
}
|
||||||
m.StopTorrentClient()
|
m.StopTorrentClient()
|
||||||
m.communityLock.Release()
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue