upgrade fsnotify to 1.6.0 and change reactivate logic slightly

This commit is contained in:
Drew Weymouth
2023-06-17 18:07:16 -07:00
parent 20e4d8c5f2
commit 1f272829c7
3 changed files with 9 additions and 6 deletions
+3 -2
View File
@@ -123,8 +123,9 @@ func (a *App) startSessionWatcher(sessionPath string) {
select {
case <-a.bgrndCtx.Done():
return
case event, ok := <-sessionWatch.Events:
if ok && event.Op == fsnotify.Create && path.Base(event.Name) == sessionActivateFile {
case <-sessionWatch.Events:
activatePath := path.Join(sessionPath, sessionActivateFile)
if _, err := os.Stat(activatePath); err == nil {
os.Remove(path.Join(sessionPath, sessionActivateFile))
if a.OnReactivate != nil {
a.OnReactivate()