filed

Job queue using FUSE

git clone git://mccd.space/filed

commit 556c14c3038d062a0caee9e66584813a59f2c971
parent 154a0a45320da2d87d2599a2c92e121bb49eb707
Author: Marc Coquand <marc@coquand.email>
Date:   Mon, 15 Dec 2025 12:56:44 +0100

Change to two second timer

Might be better?

Diffstat:
Mmanager.go | 4++--
Mqj.1.scd | 5+++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/manager.go b/manager.go
@@ -26,7 +26,7 @@ func NewJobManager(s *store.Store) *JobManager {
 }
 
 func (jm *JobManager) StartWorker(ctx context.Context) {
-	ticker := time.NewTicker(1 * time.Second)
+	ticker := time.NewTicker(2 * time.Second)
 	go func() {
 		for {
 			select {
@@ -57,6 +57,7 @@ func (jm *JobManager) processPendingJobs() {
 			jm.store.FailJob(job.ID)
 			continue
 		}
+		slog.Info("Worker: Starting job", "id", job.ID, "cmd", job.Command, "attempt", job.Attempt)
 		if err := jm.store.AttemptJob(job.ID); err != nil {
 			slog.Error("Worker: Failed to claim job", "id", job.ID, "error", err)
 			continue
@@ -68,7 +69,6 @@ func (jm *JobManager) processPendingJobs() {
 
 func (jm *JobManager) runJob(id, commandStr string) {
 	timeout_seconds := jm.store.GetConfig().TimeoutSec
-	slog.Info("Worker: Starting job", "id", id, "cmd", commandStr)
 
 	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout_seconds)*time.Second)
 	defer cancel()
diff --git a/qj.1.scd b/qj.1.scd
@@ -48,8 +48,9 @@ access to the system.
 It is recommended to that the admin updates the users and group to apply
 principle of least access. Importantly, the system is intended for only
 trusted scripts: the job user has access to the state, and is thus able to
-rewrite access rights. However, users can use _namespaces(7)_ or _Landlock(7)_
-to limit access rights of the running script.
+rewrite access rights. However, users is recommended to use _namespaces(7)_
+or _Landlock(7)_ to limit access rights of the running script so that the
+state can not be rewritten. More security features are coming in the future.
 
 Access rights can be modified using _CHOWN(1)_ and _CHMOD(1)_.