comparison 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
comparison
equal deleted inserted replaced
252:33fa478c119a 253:3bc442765b88
54 return 0; 54 return 0;
55 } 55 }
56 56
57 try 57 try
58 { 58 {
59 const size_t countConnections = 5; // TODO - PARAMETER 59 const size_t countConnections = postgresql.GetUnsignedIntegerValue("IndexConnectionsCount", 1);
60 const unsigned int maxDatabaseRetries = 10; // TODO - PARAMETER 60
61
62 OrthancDatabases::PostgreSQLParameters parameters(postgresql); 61 OrthancDatabases::PostgreSQLParameters parameters(postgresql);
63 OrthancDatabases::IndexBackend::Register( 62 OrthancDatabases::IndexBackend::Register(
64 new OrthancDatabases::PostgreSQLIndex(context, parameters), countConnections, maxDatabaseRetries); 63 new OrthancDatabases::PostgreSQLIndex(context, parameters), countConnections,
64 parameters.GetMaxConnectionRetries());
65 } 65 }
66 catch (Orthanc::OrthancException& e) 66 catch (Orthanc::OrthancException& e)
67 { 67 {
68 LOG(ERROR) << e.What(); 68 LOG(ERROR) << e.What();
69 return -1; 69 return -1;