Browse Source

update: reduce delay time

dev
Dnomd343 2 years ago
parent
commit
02a6c89d22
  1. 1
      src/loader/loader.c
  2. 6
      src/utils/process.c

1
src/loader/loader.c

@ -127,6 +127,7 @@ crontab* load_crond(cleardns_config *config) {
assets* load_assets(cleardns_config *config) { assets* load_assets(cleardns_config *config) {
assets *resource = assets_init(); assets *resource = assets_init();
// TODO: use ASSETS_DIR
string_list_update(&resource->update_file, config->assets.update_file); string_list_update(&resource->update_file, config->assets.update_file);
string_list_update(&resource->update_url, config->assets.update_url); string_list_update(&resource->update_url, config->assets.update_url);
return resource; return resource;

6
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 signal(SIGCHLD, get_sub_exit); // callback when child process die
for (process **proc = process_list; *proc != NULL; ++proc) { for (process **proc = process_list; *proc != NULL; ++proc) {
process_exec(*proc); process_exec(*proc);
usleep(200 * 1000); // delay 200ms usleep(50 * 1000); // delay 50ms
} }
log_info("Process start complete"); log_info("Process start complete");
} }
@ -173,9 +173,9 @@ void get_sub_exit() { // catch child process exit
server_exit(EXIT_WAIT_ERROR); server_exit(EXIT_WAIT_ERROR);
} else if (wait_ret) { // catch process exit } else if (wait_ret) { // catch process exit
show_exit_info(get_exit_info(status, (*proc)->pid), (*proc)->name); show_exit_info(get_exit_info(status, (*proc)->pid), (*proc)->name);
sleep(3); // reduce restart frequency sleep(1); // reduce restart frequency
process_exec(*proc); process_exec(*proc);
usleep(200 * 1000); // delay 200ms usleep(50 * 1000); // delay 50ms
log_info("%s restart complete", (*proc)->name); log_info("%s restart complete", (*proc)->name);
return; // skip following check return; // skip following check
} }

Loading…
Cancel
Save