filed

Job queue using FUSE

git clone git://mccd.space/filed

commit 2d9f568df1385b6d01731bb776eb29d4e9fd7045
parent f8047bf8e3a8fd9899a89cfeb4e319ce5ab5dde0
Author: Marc Coquand <marc@coquand.email>
Date:   Sun, 14 Dec 2025 19:47:36 +0100

Set max concurrent job count

Diffstat:
Mmanager.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/manager.go b/manager.go
@@ -47,6 +47,10 @@ func (jm *JobManager) processPendingJobs() {
 		return
 	}
 
+	if len(jobs) >= conf.MaxJobCount {
+		return
+	}
+
 	for _, job := range jobs {
 		if job.Attempts >= conf.MaxAttempts {
 			slog.Warn("Worker: job exceeded max attempts. Moving to failed", "Job", job.ID)