MCPcopy Create free account
hub / github.com/MertJSX/folderhost / WatcherDestroyer

Function WatcherDestroyer

middleware/websocket/file_watcher.go:17–26  ·  view source on GitHub ↗
(path string, ch chan bool)

Source from the content-addressed store, hash-verified

15)
16
17func WatcherDestroyer(path string, ch chan bool) {
18 for {
19 if utils.GetClientsCount(path) == 0 {
20 cache.EditorWatcherCache.Delete(path)
21 ch <- true
22 return
23 }
24 time.Sleep(3 * time.Second)
25 }
26}
27
28func SetupWatcher(path string, stopChan chan bool) {
29 watcher, err := fsnotify.NewWatcher()

Callers 1

HandleWebsocketFunction · 0.85

Calls 2

GetClientsCountFunction · 0.92
DeleteMethod · 0.80

Tested by

no test coverage detected