mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
[MySQL] Add keepalives to UCS and Loginserver (#2953)
This commit is contained in:
parent
d6c6b78d8a
commit
ce1472db1e
@ -288,9 +288,16 @@ int main(int argc, char **argv)
|
|||||||
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());
|
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());
|
||||||
LogInfo("[Config] [Security] IsUpdatingInsecurePasswords [{0}]", server.options.IsUpdatingInsecurePasswords());
|
LogInfo("[Config] [Security] IsUpdatingInsecurePasswords [{0}]", server.options.IsUpdatingInsecurePasswords());
|
||||||
|
|
||||||
|
Timer keepalive(INTERSERVER_TIMER); // does auto-reconnect
|
||||||
|
|
||||||
auto loop_fn = [&](EQ::Timer* t) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
|
if (keepalive.Check()) {
|
||||||
|
keepalive.Start();
|
||||||
|
server.db->ping();
|
||||||
|
}
|
||||||
|
|
||||||
if (!run_server) {
|
if (!run_server) {
|
||||||
EQ::EventLoop::Get().Shutdown();
|
EQ::EventLoop::Get().Shutdown();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -114,7 +114,7 @@ int main() {
|
|||||||
Timer ChannelListProcessTimer(60000);
|
Timer ChannelListProcessTimer(60000);
|
||||||
Timer ClientConnectionPruneTimer(60000);
|
Timer ClientConnectionPruneTimer(60000);
|
||||||
|
|
||||||
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
|
Timer keepalive(INTERSERVER_TIMER); // does auto-reconnect
|
||||||
|
|
||||||
LogInfo("Starting EQEmu Universal Chat Server");
|
LogInfo("Starting EQEmu Universal Chat Server");
|
||||||
|
|
||||||
@ -188,6 +188,10 @@ int main() {
|
|||||||
// crash_test.detach();
|
// crash_test.detach();
|
||||||
|
|
||||||
auto loop_fn = [&](EQ::Timer* t) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
|
if (keepalive.Check()) {
|
||||||
|
keepalive.Start();
|
||||||
|
database.ping();
|
||||||
|
}
|
||||||
|
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user