filed

Job queue using FUSE

git clone git://mccd.space/filed

commit 7e87e7cb464a3af4179c5cadb53855fbefe72aeb
parent 0a5d260e15b789661145c07b950577f6c21bb52a
Author: Marc Coquand <marc@coquand.email>
Date:   Mon, 22 Dec 2025 10:58:14 +0100

Docs

Diffstat:
Mmanager.go | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/manager.go b/manager.go
@@ -53,21 +53,20 @@ func NewJobManager(s *store.Store, filedLaunchExecutablePath string, restriction
 		store:        s,
 		execCmd:      filedLaunchExecutablePath,
 		restrictions: &argRestrictions,
-		notifyChan:   make(chan struct{}, 1),
+
+		// Buffer size 1 = Ignore more than one signal so we don't process jobs too many times
+		notifyChan: make(chan struct{}, 1),
 	}
 }
 
 type signal struct{}
 
-// Notifies to rerun jobs
-//
-// Buffer has size 1, so if it's full, nothing will happen.
-// This means that for concurrent jobs, a signal can be sent
-// multiple times but only be processed once.
+// Notifies to process jobs
 func (jm *JobManager) notify() {
 	select {
 	case jm.notifyChan <- signal{}:
 	default:
+		// Already signaled to process jobs, ignore.
 	}
 }