123456789101112131415161718192021222324 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package tasker
- import (
- "os"
- "syscall"
- )
- var (
- interrupt = false
- )
- func SignalNotify(signal os.Signal) {
- switch signal {
- case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL:
- interrupt = true
- }
- }
- func Interrupted() bool {
- return interrupt
- }
|