Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close fsnotify watcher on SIGTERM and SIGINT #4

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@ivanovalex02
Copy link

ivanovalex02 commented Apr 2, 2019

Fix issue #3

@josh
Copy link
Owner

josh left a comment

Ensuring the watcher is closed makes sense. Just had one question.


sigRun := make(chan os.Signal, 1)
signal.Notify(sigRun, syscall.SIGUSR1)

for {
select {
case <-sigTerm:
watcher.Close()
os.Exit(1)
goto Exit

This comment has been minimized.

Copy link
@josh

josh Apr 2, 2019

Owner

Would a return also work here?

This comment has been minimized.

Copy link
@ivanovalex02

ivanovalex02 Apr 3, 2019

Author

Sure, it would work until you decide to add something after Exit.

@josh josh closed this Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.