dabue opened a new pull request #2397:
URL: https://github.com/apache/apisix/pull/2397


   fix #2170 
   
   Use a small time interval (such as 1s) to complete a relatively long sleep 
behavior, so that the worker process can be shut down gracefully.
   
   ยทยทยท
   local max_sleep_interval = 1
   
   local function sleep(sec)
       if sec <= max_sleep_interval then
           ngx_sleep(sec)
           return
       end
       ngx_sleep(max_sleep_interval)
       if exiting() then
           return
       end
       sec = sec - max_sleep_interval
       sleep(sec)
   end
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to