MCPcopy
hub / github.com/go-task/task / closeOnInterrupt

Function closeOnInterrupt

watch.go:155–163  ·  view source on GitHub ↗
(w *fsnotify.Watcher)

Source from the content-addressed store, hash-verified

153}
154
155func closeOnInterrupt(w *fsnotify.Watcher) {
156 ch := make(chan os.Signal, 1)
157 signal.Notify(ch, os.Interrupt, syscall.SIGTERM)
158 go func() {
159 <-ch
160 w.Close()
161 os.Exit(0)
162 }()
163}
164
165func (e *Executor) registerWatchedDirs(w *fsnotify.Watcher, calls ...*Call) error {
166 files, err := e.collectSources(calls)

Callers 1

watchTasksMethod · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…