[MySQL] Add keepalives to UCS and Loginserver (#2953)

This commit is contained in:
Chris Miles 2023-02-18 05:40:51 -06:00 committed by GitHub
parent d6c6b78d8a
commit ce1472db1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -288,9 +288,16 @@ int main(int argc, char **argv)
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());
LogInfo("[Config] [Security] IsUpdatingInsecurePasswords [{0}]", server.options.IsUpdatingInsecurePasswords());
Timer keepalive(INTERSERVER_TIMER); // does auto-reconnect
auto loop_fn = [&](EQ::Timer* t) {
Timer::SetCurrentTime();
if (keepalive.Check()) {
keepalive.Start();
server.db->ping();
}
if (!run_server) {
EQ::EventLoop::Get().Shutdown();
return;

View File

@ -114,7 +114,7 @@ int main() {
Timer ChannelListProcessTimer(60000);
Timer ClientConnectionPruneTimer(60000);
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
Timer keepalive(INTERSERVER_TIMER); // does auto-reconnect
LogInfo("Starting EQEmu Universal Chat Server");
@ -188,6 +188,10 @@ int main() {
// crash_test.detach();
auto loop_fn = [&](EQ::Timer* t) {
if (keepalive.Check()) {
keepalive.Start();
database.ping();
}
Timer::SetCurrentTime();