mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
Add support for graceful shutdown
Fixes #1014 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -711,8 +711,10 @@ func (m *Manager) removeTask() {
|
||||
|
||||
// Cleanup releases all the active plugins
|
||||
func (m *Manager) Cleanup() {
|
||||
if m.closed.Swap(true) {
|
||||
return
|
||||
}
|
||||
logger.Debug(logSender, "", "cleanup")
|
||||
m.closed.Store(true)
|
||||
close(m.done)
|
||||
m.notifLock.Lock()
|
||||
for _, n := range m.notifiers {
|
||||
|
||||
Reference in New Issue
Block a user