Browse Source

update: restart delay

dev
Dnomd343 2 years ago
parent
commit
b4245918e1
  1. 1
      include/constant.h
  2. 3
      src/utils/process.c

1
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"

3
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

Loading…
Cancel
Save