core/manager: Make sure jobs statistics are not double after daemon-reload

We add n_installed_jobs and n_failed_jobs to our inner state after
deserialization. This is fine during daemon-reexec when we start with clear
Manager (and some jobs possibly queued before deserialization), however,
daemon-reload works with the same manager and adding the values would
effectively double the counters. Reset the counters before we deserialize and
add their values again.
This commit is contained in:
Michal Koutný 2018-06-22 16:19:52 +02:00 committed by Lennart Poettering
parent 1a0d353b44
commit 1e75824cb0
1 changed files with 2 additions and 0 deletions

View File

@ -1234,6 +1234,8 @@ static void manager_clear_jobs_and_units(Manager *m) {
m->n_on_console = 0;
m->n_running_jobs = 0;
m->n_installed_jobs = 0;
m->n_failed_jobs = 0;
}
Manager* manager_free(Manager *m) {