changeset 490:b3876cbb93a2

Fix check of Orthanc runtime version
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Mar 2024 14:36:38 +0100
parents e8b4bb6a33e7
children 711b136e8fe8
files Framework/Plugins/PluginInitialization.cpp PostgreSQL/NEWS
diffstat 2 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/PluginInitialization.cpp	Fri Mar 22 14:27:36 2024 +0100
+++ b/Framework/Plugins/PluginInitialization.cpp	Fri Mar 22 14:36:38 2024 +0100
@@ -59,6 +59,19 @@
     assert(DisplayPerformanceWarning(dbms, isIndex));
 
     /* Check the version of the Orthanc core */
+    if (OrthancPluginCheckVersion(context) == 0)
+    {
+      LOG(ERROR) << "Your version of Orthanc ("
+                 << context->orthancVersion << ") must be above "
+                 << ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER << "."
+                 << ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER << "."
+                 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER
+                 << " to run this plugin";
+      return false;
+    }
+
+
+    /* Warn the user if the Orthanc runtime has not an optimal version */
 
     bool useFallback = true;
     bool isOptimal = false;
@@ -89,18 +102,6 @@
 #  endif
 #endif
 
-    if (useFallback &&
-        OrthancPluginCheckVersion(context) == 0)
-    {
-      LOG(ERROR) << "Your version of Orthanc (" 
-                 << context->orthancVersion << ") must be above "
-                 << ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER << "."
-                 << ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER << "."
-                 << ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER
-                 << " to run this plugin";
-      return false;
-    }
-
     if (useFallback)
     {
       std::string v(context->orthancVersion);
--- a/PostgreSQL/NEWS	Fri Mar 22 14:27:36 2024 +0100
+++ b/PostgreSQL/NEWS	Fri Mar 22 14:36:38 2024 +0100
@@ -3,7 +3,8 @@
 
 DB schema revision: 2
 
-* Fixed handling of MaximumStorageSize & MaximumPatientCount.
+* Fix handling of MaximumStorageSize & MaximumPatientCount.
+* Fix check of Orthanc runtime version
 
 
 Release 6.0 (2024-02-08)