sftpgo-mirror/service/signals_windows.go

22 lines
361 B
Go
Raw Normal View History

2021-03-25 18:31:21 +00:00
package service
import (
"os"
"os/signal"
2021-06-26 05:31:41 +00:00
"github.com/drakkan/sftpgo/v2/logger"
"github.com/drakkan/sftpgo/v2/sdk/plugin"
2021-03-25 18:31:21 +00:00
)
func registerSignals() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
for range c {
logger.Debug(logSender, "", "Received interrupt request")
plugin.Handler.Cleanup()
2021-03-25 18:31:21 +00:00
os.Exit(0)
}
}()
}