1
mirror of https://github.com/rclone/rclone synced 2024-11-17 17:30:37 +01:00
rclone/cmd/siginfo_darwin.go
2021-09-09 20:43:59 +03:00

25 lines
378 B
Go

//go:build darwin
// +build darwin
package cmd
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/rclone/rclone/fs/accounting"
)
// 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())
}
}()
}