From 0c99ff1d5aceb29e06cbaade8e66958f77c95ddd Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 3 Oct 2023 19:33:02 +0300 Subject: [PATCH] Sleep and log --- tapeget.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tapeget.lua b/tapeget.lua index 42d7785..732b93e 100644 --- a/tapeget.lua +++ b/tapeget.lua @@ -21,6 +21,10 @@ if not req then return end +local headers = req.getResponseHeaders() +local length = headers["content-length"] + +local i = 1 while true do local chunk = req.read() if not chunk then @@ -28,6 +32,11 @@ while true do break end tape.write(chunk) + i = i + 1 + if (i % 16384) == 0 then + os.sleep(0.01) + print(i .. " written out of "..length) + end end tape.stop()