Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Too slow when stopping the script #16

Open
yurisasuke opened this issue Jan 16, 2019 · 1 comment
Open

Too slow when stopping the script #16

yurisasuke opened this issue Jan 16, 2019 · 1 comment

Comments

@yurisasuke
Copy link

Am not sure why but whenever i add this library it takes too long to stop my application.

@kfur
Copy link

kfur commented Jan 23, 2019

@Keithwachira just register handler for interrupt signal. It will solve your problem.

signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, os.Interrupt)
go func() {
	<-signalChan
	os.Exit(0)
}()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants