From 02a6c89d229bf08a2339dd4efd1fd56ede1d684c Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 26 Sep 2022 23:29:09 +0800 Subject: [PATCH] update: reduce delay time --- src/loader/loader.c | 1 + src/utils/process.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/loader/loader.c b/src/loader/loader.c index 5ef8029..8d4b8e0 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -127,6 +127,7 @@ crontab* load_crond(cleardns_config *config) { assets* load_assets(cleardns_config *config) { assets *resource = assets_init(); + // TODO: use ASSETS_DIR string_list_update(&resource->update_file, config->assets.update_file); string_list_update(&resource->update_url, config->assets.update_url); return resource; diff --git a/src/utils/process.c b/src/utils/process.c index 7f2de14..c96539f 100644 --- a/src/utils/process.c +++ b/src/utils/process.c @@ -96,7 +96,7 @@ void process_list_run() { // start process list signal(SIGCHLD, get_sub_exit); // callback when child process die for (process **proc = process_list; *proc != NULL; ++proc) { process_exec(*proc); - usleep(200 * 1000); // delay 200ms + usleep(50 * 1000); // delay 50ms } log_info("Process start complete"); } @@ -173,9 +173,9 @@ void get_sub_exit() { // catch child process exit server_exit(EXIT_WAIT_ERROR); } else if (wait_ret) { // catch process exit show_exit_info(get_exit_info(status, (*proc)->pid), (*proc)->name); - sleep(3); // reduce restart frequency + sleep(1); // reduce restart frequency process_exec(*proc); - usleep(200 * 1000); // delay 200ms + usleep(50 * 1000); // delay 50ms log_info("%s restart complete", (*proc)->name); return; // skip following check }