nic-6443 commented on code in PR #12200:
URL: https://github.com/apache/apisix/pull/12200#discussion_r2088329077


##########
apisix/admin/standalone.lua:
##########
@@ -193,8 +206,28 @@ function _M.run()
     end
 end
 
+local function cleanup_on_exit()
+    if ngx.worker.exiting() then
+        local status_shdict = ngx.shared.status_report_standalone
+        local pid = tostring(ngx.worker.pid())
+        status_shdict:delete(pid)
+        core.log.info("worker ", pid, " removed itself on exit")
+        return
+    end
+
+    -- Reschedule the timer to check again
+    local ok, err = ngx.timer.at(0.1, cleanup_on_exit)

Review Comment:
   got 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to