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)
|
kong.log.err("Reading request body from file start time : ", start_time)
|
||||||
while true do
|
while true do
|
||||||
-- Check timeout
|
-- Update time and check timeout
|
||||||
kong.log.err("Checking timeout for request body reading at ", ngx.now())
|
ngx.update_time()
|
||||||
local elapsed = ngx.now() - start_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
|
if elapsed > 3 then
|
||||||
kong.log.warn("Request body reading timeout after ", elapsed, " seconds")
|
kong.log.warn("Request body reading timeout after ", elapsed, " seconds")
|
||||||
file:close()
|
file:close()
|
||||||
|
|||||||
Reference in New Issue
Block a user