mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 12:55:18 +00:00
Merge pull request #2644 from greatroar/signal-notify-buffered
Make all signal.Notify channels buffered
This commit is contained in:
commit
b7c0d4d8bf
@ -20,7 +20,7 @@ var cleanupHandlers struct {
|
|||||||
var stderr = os.Stderr
|
var stderr = os.Stderr
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cleanupHandlers.ch = make(chan os.Signal)
|
cleanupHandlers.ch = make(chan os.Signal, 1)
|
||||||
go CleanupHandler(cleanupHandlers.ch)
|
go CleanupHandler(cleanupHandlers.ch)
|
||||||
signal.Notify(cleanupHandlers.ch, syscall.SIGINT)
|
signal.Notify(cleanupHandlers.ch, syscall.SIGINT)
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ var ignoreSIGHUP sync.Once
|
|||||||
func init() {
|
func init() {
|
||||||
ignoreSIGHUP.Do(func() {
|
ignoreSIGHUP.Do(func() {
|
||||||
go func() {
|
go func() {
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, syscall.SIGHUP)
|
signal.Notify(c, syscall.SIGHUP)
|
||||||
for s := range c {
|
for s := range c {
|
||||||
debug.Log("Signal received: %v\n", s)
|
debug.Log("Signal received: %v\n", s)
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, syscall.SIGUSR1)
|
signal.Notify(c, syscall.SIGUSR1)
|
||||||
go func() {
|
go func() {
|
||||||
for s := range c {
|
for s := range c {
|
||||||
|
@ -11,9 +11,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, syscall.SIGUSR1)
|
signal.Notify(c, syscall.SIGINFO, syscall.SIGUSR1)
|
||||||
signal.Notify(c, syscall.SIGINFO)
|
|
||||||
go func() {
|
go func() {
|
||||||
for s := range c {
|
for s := range c {
|
||||||
debug.Log("Signal received: %v\n", s)
|
debug.Log("Signal received: %v\n", s)
|
||||||
|
Loading…
Reference in New Issue
Block a user