tzssangglass commented on code in PR #7826: URL: https://github.com/apache/apisix/pull/7826#discussion_r959430640
########## apisix/plugins/log-rotate.lua: ########## @@ -169,6 +171,32 @@ local function rename_file(log, date_str) end +local function wait_old_nginx_exit() + local found = true + local max_try = 10 -- 10 seconds + local prefix = ngx.config.prefix() + local file_path = prefix .. "/logs/nginx.pid.oldbin" + + for i = 1, max_try do + -- nginx will delete nginx.pid.oldbin after old master process quit + found = file_exists(file_path) + if found then + if i <= max_try then + ngx_sleep(1) + end + Review Comment: delete this blank line -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
