mirror of
https://github.com/openappsec/attachment.git
synced 2025-12-31 05:39:07 +03:00
fix ngx time
This commit is contained in:
@@ -92,9 +92,12 @@ function NanoHandler.access(conf)
|
||||
|
||||
kong.log.err("Reading request body from file start time : ", start_time)
|
||||
while true do
|
||||
-- Check timeout
|
||||
kong.log.err("Checking timeout for request body reading at ", ngx.now())
|
||||
local elapsed = ngx.now() - start_time
|
||||
-- Update time and check timeout
|
||||
ngx.update_time()
|
||||
local current_time = ngx.now()
|
||||
local elapsed = current_time - start_time
|
||||
kong.log.err("Request body reading elapsed time: ", elapsed, " seconds")
|
||||
|
||||
if elapsed > 3 then
|
||||
kong.log.warn("Request body reading timeout after ", elapsed, " seconds")
|
||||
file:close()
|
||||
|
||||
Reference in New Issue
Block a user