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

This commit is contained in:
Daniel Barlow 2024-08-14 22:39:41 +01:00
parent 45a7f96bd4
commit 310ac30f24
1 changed files with 6 additions and 1 deletions

View File

@ -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)))