MINOR: init: move apply_server_state in haproxy.c before MODE_CHECK
Currently, the function which applies server states provided by the "old" process is applied after configuration sanity check. This results in the impossibility to check the validity of the state file during a regular config check, implying a full start is required, which can be a problem sometimes. This patch moves the loading of server_state file before MODE_CHECK.
This commit is contained in:
parent
ceccdd78a7
commit
4215d7d033
|
@ -952,6 +952,12 @@ void init(int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Apply server states */
|
||||
apply_server_state();
|
||||
|
||||
for (px = proxy; px; px = px->next)
|
||||
srv_compute_all_admin_states(px);
|
||||
|
||||
if (global.mode & MODE_CHECK) {
|
||||
struct peers *pr;
|
||||
struct proxy *px;
|
||||
|
@ -973,12 +979,6 @@ void init(int argc, char **argv)
|
|||
exit(2);
|
||||
}
|
||||
|
||||
/* Apply server states */
|
||||
apply_server_state();
|
||||
|
||||
for (px = proxy; px; px = px->next)
|
||||
srv_compute_all_admin_states(px);
|
||||
|
||||
global_listener_queue_task = task_new();
|
||||
if (!global_listener_queue_task) {
|
||||
Alert("Out of memory when initializing global task\n");
|
||||
|
|
Loading…
Reference in New Issue