You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/12 23:20:08 UTC

[GitHub] [apisix] dabue commented on a change in pull request #2397: feature(core): implement `core.sleep`

dabue commented on a change in pull request #2397:
URL: https://github.com/apache/apisix/pull/2397#discussion_r503581194



##########
File path: apisix/core/utils.lua
##########
@@ -194,4 +196,22 @@ function _M.validate_header_value(value)
 end
 
 
+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
+
+
+function _M.sleep(sec)

Review comment:
       I‘ve updated it.’




----------------------------------------------------------------
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:
users@infra.apache.org