liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 310ac30f2423f8c3e0cd63575a7e929aa9f8ea02
parent 45a7f96bd49c1953dbc192905bf672f4f4f3e46e
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 14 Aug 2024 22:39:41 +0100

http-fstree needs to write state and .lock for anoia.svc

Diffstat:
Mpkgs/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 @@ -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)))