diff PostgreSQL/Plugins/IndexPlugin.cpp @ 253:3bc442765b88

new configuration option: "IndexConnectionsCount"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Apr 2021 15:08:51 +0200
parents d1b124d116c1
children ece4663dedde
line wrap: on
line diff
--- a/PostgreSQL/Plugins/IndexPlugin.cpp	Wed Apr 14 13:33:48 2021 +0200
+++ b/PostgreSQL/Plugins/IndexPlugin.cpp	Wed Apr 14 15:08:51 2021 +0200
@@ -56,12 +56,12 @@
 
     try
     {
-      const size_t countConnections = 5;  // TODO - PARAMETER
-      const unsigned int maxDatabaseRetries = 10;  // TODO - PARAMETER
-      
+      const size_t countConnections = postgresql.GetUnsignedIntegerValue("IndexConnectionsCount", 1);
+
       OrthancDatabases::PostgreSQLParameters parameters(postgresql);
       OrthancDatabases::IndexBackend::Register(
-        new OrthancDatabases::PostgreSQLIndex(context, parameters), countConnections, maxDatabaseRetries);
+        new OrthancDatabases::PostgreSQLIndex(context, parameters), countConnections,
+        parameters.GetMaxConnectionRetries());
     }
     catch (Orthanc::OrthancException& e)
     {