diff --git a/include/constant.h b/include/constant.h index a1dbc16..63f4f53 100644 --- a/include/constant.h +++ b/include/constant.h @@ -10,6 +10,7 @@ #define DOMESTIC_PORT 4053 #define FOREIGN_PORT 6053 +#define RESTART_DELAY 1 #define DIVERTER_TIMEOUT 6 #define VERSION "1.3.0-rc1" diff --git a/src/utils/process.c b/src/utils/process.c index c48c886..5eadb3a 100644 --- a/src/utils/process.c +++ b/src/utils/process.c @@ -164,8 +164,7 @@ void get_sub_exit() { // catch child process exit char *exit_msg = get_exit_msg(status); log_warn("%s (PID = %d) -> %s", (*proc)->name, (*proc)->pid, exit_msg); free(exit_msg); - // TODO: delay with global const - sleep(1); // reduce restart frequency + sleep(RESTART_DELAY); // reduce restart frequency process_exec(*proc); log_info("%s restart complete", (*proc)->name); return; // skip following check