changeset 744:55a827c8913a

adding a 1 sec delay to allow time for propagation to read-replicas
author Alain Mazy <am@orthanc.team>
date Fri, 03 Oct 2025 18:57:04 +0200
parents 78fdfbe7b1fd
children 54bdb6c3bbba
files PostgreSQL/Plugins/PostgreSQLIndex.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Fri Oct 03 18:39:46 2025 +0200
+++ b/PostgreSQL/Plugins/PostgreSQLIndex.cpp	Fri Oct 03 18:57:04 2025 +0200
@@ -277,6 +277,9 @@
         {
           int currentRevision = 0;
 
+          // wait 1s before reading the patch level in case you are using read-replicas
+          boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
+
           if (!LookupGlobalIntegerProperty(currentRevision, manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel))
           {
             LOG(ERROR) << "No Database revision found after the upgrade !";