mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Core/Updater): Add configurable shutdown delay on update exceptions (#23042)
This commit is contained in:
@@ -343,6 +343,14 @@ Updates.AllowRehash = 1
|
|||||||
|
|
||||||
Updates.CleanDeadRefMaxCount = 3
|
Updates.CleanDeadRefMaxCount = 3
|
||||||
|
|
||||||
|
#
|
||||||
|
# Updates.ExceptionShutdownDelay
|
||||||
|
# Description: Time (in milliseconds) to wait before shutting down after a fatal exception (e.g. failed SQL update).
|
||||||
|
# Default: 10000 - 10 seconds
|
||||||
|
# 0 - Disabled (immediate shutdown)
|
||||||
|
|
||||||
|
Updates.ExceptionShutdownDelay = 10000
|
||||||
|
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
|||||||
@@ -518,8 +518,13 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
|
|||||||
path.generic_string(), pool.GetConnectionInfo()->database);
|
path.generic_string(), pool.GetConnectionInfo()->database);
|
||||||
|
|
||||||
if (!sConfigMgr->isDryRun())
|
if (!sConfigMgr->isDryRun())
|
||||||
|
{
|
||||||
|
if (uint32 delay = sConfigMgr->GetOption<uint32>("Updates.ExceptionShutdownDelay", 10000))
|
||||||
|
std::this_thread::sleep_for(Milliseconds(delay));
|
||||||
|
|
||||||
throw UpdateException("update failed");
|
throw UpdateException("update failed");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template class AC_DATABASE_API DBUpdater<LoginDatabaseConnection>;
|
template class AC_DATABASE_API DBUpdater<LoginDatabaseConnection>;
|
||||||
|
|||||||
Reference in New Issue
Block a user