mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 06:03:02 +01:00
Prevent guardian from to often server restarts
This commit is contained in:
parent
a32a58543c
commit
12bfa56b3b
@ -27,6 +27,10 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@ -41,6 +45,8 @@
|
||||
int errno = -1;
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "../jrd/common.h"
|
||||
#include "../jrd/divorce.h"
|
||||
#include "../jrd/isc_proto.h"
|
||||
@ -173,6 +179,8 @@ int CLIB_ROUTINE main( int argc, char **argv)
|
||||
// detach from controlling tty
|
||||
divorce_terminal(0);
|
||||
|
||||
time_t timer = 0;
|
||||
|
||||
do {
|
||||
int ret_code;
|
||||
|
||||
@ -181,6 +189,18 @@ int CLIB_ROUTINE main( int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (timer == time(0))
|
||||
{
|
||||
// don't let fbserver restart too often - avoid log overflow
|
||||
#ifdef WIN_NT
|
||||
Sleep(1000);
|
||||
#else
|
||||
sleep(1);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
timer = time(0);
|
||||
|
||||
gds__log("%s: guardian starting %s\n",
|
||||
prog_name, SUPER_SERVER_BINARY);
|
||||
pid_t child_pid = UTIL_start_process(SUPER_SERVER_BINARY, server_args);
|
||||
|
Loading…
Reference in New Issue
Block a user