From 2ae323feee19bc45953dea758fd56e2692492e8a Mon Sep 17 00:00:00 2001 From: Unbit Date: Wed, 6 Mar 2013 19:55:20 +0100 Subject: [PATCH] better broodlord num computation --- core/emperor.c | 6 +++++- uwsgi.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/emperor.c b/core/emperor.c index 67d8b386..765eb28d 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -591,6 +591,10 @@ void emperor_add(struct uwsgi_emperor_scanner *ues, char *name, time_t born, cha } } + if (n_ui->zerg) { + uwsgi.emperor_broodlord_num++; + } + // TODO pre-start hook // a new uWSGI instance will start @@ -655,7 +659,7 @@ void emperor_add(struct uwsgi_emperor_scanner *ues, char *name, time_t born, cha // add UWSGI_BROODLORD_NUM if (n_ui->zerg) { - uef = uwsgi_num2str(uwsgi.emperor_broodlord_count); + uef = uwsgi_num2str(uwsgi.emperor_broodlord_num); if (setenv("UWSGI_BROODLORD_NUM", uef, 1)) { uwsgi_error("setenv()"); exit(1); diff --git a/uwsgi.h b/uwsgi.h index 67de937c..1b05edbc 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1604,6 +1604,7 @@ struct uwsgi_server { pid_t emperor_pid; int emperor_broodlord; int emperor_broodlord_count; + uint64_t emperor_broodlord_num; char *emperor_stats; int emperor_stats_fd; struct uwsgi_string_list *vassals_templates;