mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
Add support for graceful shutdown
Fixes #1014 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/drakkan/sftpgo/v2/internal/common"
|
||||
"github.com/drakkan/sftpgo/v2/internal/logger"
|
||||
"github.com/drakkan/sftpgo/v2/internal/plugin"
|
||||
)
|
||||
@@ -29,6 +30,7 @@ func registerSignals() {
|
||||
for range c {
|
||||
logger.Debug(logSender, "", "Received interrupt request")
|
||||
plugin.Handler.Cleanup()
|
||||
common.WaitForTransfers(graceTime)
|
||||
os.Exit(0)
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user