mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 21:21:53 +00:00
improved gevent graceful reload
This commit is contained in:
@@ -1471,6 +1471,7 @@ static void cheaper_algo_list(void) {
|
||||
uwsgi_log("--- end of cheaper algorithms list ---\n\n");
|
||||
}
|
||||
|
||||
#ifdef UWSGI_ROUTING
|
||||
static void router_list(void) {
|
||||
struct uwsgi_router *ur = uwsgi.routers;
|
||||
uwsgi_log("\n*** uWSGI loaded routers ***\n");
|
||||
@@ -1480,6 +1481,7 @@ static void router_list(void) {
|
||||
}
|
||||
uwsgi_log("--- end of routers list ---\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void loop_list(void) {
|
||||
int i;
|
||||
@@ -1994,8 +1996,10 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||
cheaper_algo_list();
|
||||
|
||||
|
||||
#ifdef UWSGI_ROUTING
|
||||
if (uwsgi.router_list)
|
||||
router_list();
|
||||
#endif
|
||||
|
||||
|
||||
if (uwsgi.loop_list)
|
||||
|
||||
@@ -47,8 +47,6 @@ struct uwsgi_option gevent_options[] = {
|
||||
|
||||
PyObject *py_uwsgi_gevent_graceful(PyObject *self, PyObject *args) {
|
||||
|
||||
uwsgi_log("%p %p\n", self, args);
|
||||
|
||||
uwsgi_log("Gracefully killing worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
|
||||
uwsgi.workers[uwsgi.mywid].manage_next_request = 0;
|
||||
|
||||
@@ -63,6 +61,10 @@ PyObject *py_uwsgi_gevent_graceful(PyObject *self, PyObject *args) {
|
||||
}
|
||||
uwsgi_log("main gevent watchers stopped for worker %d (pid: %d)...\n", uwsgi.mywid, uwsgi.mypid);
|
||||
|
||||
if (args) {
|
||||
exit(UWSGI_RELOAD_CODE);
|
||||
}
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
@@ -73,6 +75,8 @@ void uwsgi_gevent_gbcw() {
|
||||
|
||||
py_uwsgi_gevent_graceful(NULL, NULL);
|
||||
|
||||
exit(0);
|
||||
|
||||
}
|
||||
|
||||
struct wsgi_request *uwsgi_gevent_current_wsgi_req(void) {
|
||||
|
||||
@@ -526,7 +526,9 @@ next:
|
||||
|
||||
|
||||
|
||||
#ifdef UWSGI_EMBEDDED
|
||||
PyDoc_STRVAR(uwsgi_py_doc, "uWSGI api module.");
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PYTHREE
|
||||
|
||||
Reference in New Issue
Block a user