diff OrthancServer/Sources/OrthancInitialization.cpp @ 4185:b289a1234822

giving a try to cross-platform compilation of SyncStorageArea
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 14 Sep 2020 18:09:30 +0200
parents c02a2d9efbc2
children 0034f855c023
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancInitialization.cpp	Sat Sep 12 16:03:48 2020 +0200
+++ b/OrthancServer/Sources/OrthancInitialization.cpp	Mon Sep 14 18:09:30 2020 +0200
@@ -314,7 +314,9 @@
       FilesystemStorage storage_;
 
     public:
-      FilesystemStorageWithoutDicom(const std::string& path) : storage_(path)
+      FilesystemStorageWithoutDicom(const std::string& path,
+                                    bool fsyncOnWrite) :
+        storage_(path, fsyncOnWrite)
       {
       }
 
@@ -367,14 +369,17 @@
 
     LOG(WARNING) << "Storage directory: " << storageDirectory;
 
+    // New in Orthanc 1.7.4
+    bool fsyncOnWrite = lock.GetConfiguration().GetBooleanParameter("SyncStorageArea", true);
+
     if (lock.GetConfiguration().GetBooleanParameter("StoreDicom", true))
     {
-      return new FilesystemStorage(storageDirectory.string());
+      return new FilesystemStorage(storageDirectory.string(), fsyncOnWrite);
     }
     else
     {
       LOG(WARNING) << "The DICOM files will not be stored, Orthanc running in index-only mode";
-      return new FilesystemStorageWithoutDicom(storageDirectory.string());
+      return new FilesystemStorageWithoutDicom(storageDirectory.string(), fsyncOnWrite);
     }
   }