From 310ac30f2423f8c3e0cd63575a7e929aa9f8ea02 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 14 Aug 2024 22:39:41 +0100 Subject: [PATCH] http-fstree needs to write state and .lock for anoia.svc --- pkgs/http-fstree/http-fstree.fnl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/http-fstree/http-fstree.fnl b/pkgs/http-fstree/http-fstree.fnl index 6e83a19..4f578c1 100644 --- a/pkgs/http-fstree/http-fstree.fnl +++ b/pkgs/http-fstree/http-fstree.fnl @@ -9,8 +9,13 @@ (assert nil (.. "error " code ": " str)) (body { : last-modified }) - (let [service (svc.open dest)] + (let [service (svc.open dest) + lock (.. dest "/.lock") + state (.. dest "/state")] + (with-open [fout (io.open lock :w)] (fout:write "")) (service:output "." (json.decode body)) + (with-open [fout (io.open state :w)] (fout:write "ok")) + (os.remove lock) (utime dest last-modified)))) (fn run [] (download (. arg 1) (. arg 2)))