diff options
-rw-r--r-- | data/sql/updates/db_world/2025_10_01_02.sql | 3 | ||||
-rw-r--r-- | src/server/apps/worldserver/worldserver.conf.dist | 8 | ||||
-rw-r--r-- | src/server/database/Updater/DBUpdater.cpp | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/data/sql/updates/db_world/2025_10_01_02.sql b/data/sql/updates/db_world/2025_10_01_02.sql new file mode 100644 index 0000000000..748f761d5c --- /dev/null +++ b/data/sql/updates/db_world/2025_10_01_02.sql @@ -0,0 +1,3 @@ +-- DB update 2025_10_01_01 -> 2025_10_01_02 +UPDATE `creature_template_model` SET `VerifiedBuild` = 51831 WHERE `CreatureID` IN (33666, 33669); +UPDATE `creature_template_model` SET `Probability` = 0 WHERE `CreatureID` = 33669 AND `CreatureDisplayID` = 27343; diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 8f54e0dd0e..89863ac4f9 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -344,6 +344,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 + +# ################################################################################################### ################################################################################################### diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index eecce68a12..442b48bcb8 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -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"); + } } } |