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:
Patryk Osmaczko 2024-04-17 16:09:09 +02:00 committed by osmaczko
parent 9d309886f7
commit bd91f5ab49
1 changed files with 0 additions and 5 deletions

View File

@ -150,10 +150,6 @@ func (c *CommunityLock) Init() {
c.locks = make(map[string]*sync.Mutex)
}
func (c *CommunityLock) Release() {
c.locks = nil
}
type HistoryArchiveDownloadTask struct {
CancelChan chan struct{}
Waiter sync.WaitGroup
@ -579,7 +575,6 @@ func (m *Manager) Stop() error {
close(c)
}
m.StopTorrentClient()
m.communityLock.Release()
return nil
}