1
0
Fork 0

Sleep and log

This commit is contained in:
Casey 2023-10-03 19:33:02 +03:00
parent 666a0127e1
commit 0c99ff1d5a
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 9 additions and 0 deletions

View File

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