diff Plugin/PluginContext.cpp @ 55:b09adb6aa199

new PeerConnectivityTimeout configuration
author Alain Mazy <am@osimis.io>
date Mon, 06 Feb 2023 09:17:36 +0100
parents 44a0430d7899
children 1e396fb509ca
line wrap: on
line diff
--- a/Plugin/PluginContext.cpp	Fri Feb 03 18:44:53 2023 +0100
+++ b/Plugin/PluginContext.cpp	Mon Feb 06 09:17:36 2023 +0100
@@ -29,18 +29,20 @@
                                size_t targetBucketSize,
                                size_t maxPushTransactions,
                                size_t memoryCacheSize,
-                               unsigned int maxHttpRetries) :
+                               unsigned int maxHttpRetries,
+                               unsigned int peerConnectivityTimeout) :
     pushTransactions_(maxPushTransactions),
     semaphore_(threadsCount),
     pluginUuid_(Orthanc::Toolbox::GenerateUuid()),
     threadsCount_(threadsCount),
     targetBucketSize_(targetBucketSize),
-    maxHttpRetries_(maxHttpRetries)
+    maxHttpRetries_(maxHttpRetries),
+    peerConnectivityTimeout_(peerConnectivityTimeout)
   {
     cache_.SetMaxMemorySize(memoryCacheSize);
 
     LOG(INFO) << "Transfers accelerator will use " << threadsCount_ << " thread(s) to run HTTP queries";
-    LOG(INFO) << "Transfers accelerator will use keep local DICOM files in a memory cache of size: "
+    LOG(INFO) << "Transfers accelerator will keep local DICOM files in a memory cache of size: "
               << OrthancPlugins::ConvertToMegabytes(memoryCacheSize) << " MB";
     LOG(INFO) << "Transfers accelerator will aim at HTTP queries of size: "
               << OrthancPlugins::ConvertToKilobytes(targetBucketSize_) << " KB";
@@ -48,6 +50,8 @@
               << maxPushTransactions << " push transaction(s) at once";
     LOG(INFO) << "Transfers accelerator will retry "
               << maxHttpRetries_ << " time(s) if some HTTP query fails";
+    LOG(INFO) << "Transfers accelerator will use "
+              << peerConnectivityTimeout_ << " seconds as a timeout when checking peers connectivity";
   }
 
 
@@ -62,10 +66,11 @@
                                  size_t targetBucketSize,
                                  size_t maxPushTransactions,
                                  size_t memoryCacheSize,
-                                 unsigned int maxHttpRetries)
+                                 unsigned int maxHttpRetries,
+                                 unsigned int peerConnectivityTimeout)
   {
     GetSingleton().reset(new PluginContext(threadsCount, targetBucketSize,
-                                           maxPushTransactions, memoryCacheSize, maxHttpRetries));
+                                           maxPushTransactions, memoryCacheSize, maxHttpRetries, peerConnectivityTimeout));
   }