rclone/cmd/siginfo_darwin.go

25 lines
378 B
Go
Raw Normal View History

2021-09-09 20:25:25 +08:00
//go:build darwin
// +build darwin
2018-05-14 02:24:56 +08:00
package cmd
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/rclone/rclone/fs/accounting"
2018-05-14 02:24:56 +08:00
)
// SigInfoHandler creates SigInfo handler
func SigInfoHandler() {
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINFO)
go func() {
for range signals {
log.Printf("%v\n", accounting.GlobalStats())
2018-05-14 02:24:56 +08:00
}
}()
}