feat(Core/Updater): Add configurable shutdown delay on update exceptions (#23042)
This commit is contained in:
parent
a0a8187ea4
commit
dbd4aaf065
2 changed files with 13 additions and 0 deletions
|
|
@ -343,6 +343,14 @@ Updates.AllowRehash = 1
|
|||
|
||||
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,7 +518,12 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
|
|||
path.generic_string(), pool.GetConnectionInfo()->database);
|
||||
|
||||
if (!sConfigMgr->isDryRun())
|
||||
{
|
||||
if (uint32 delay = sConfigMgr->GetOption<uint32>("Updates.ExceptionShutdownDelay", 10000))
|
||||
std::this_thread::sleep_for(Milliseconds(delay));
|
||||
|
||||
throw UpdateException("update failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue