Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
4184:dbd74fa2f446 | 4185:b289a1234822 |
---|---|
312 { | 312 { |
313 private: | 313 private: |
314 FilesystemStorage storage_; | 314 FilesystemStorage storage_; |
315 | 315 |
316 public: | 316 public: |
317 FilesystemStorageWithoutDicom(const std::string& path) : storage_(path) | 317 FilesystemStorageWithoutDicom(const std::string& path, |
318 bool fsyncOnWrite) : | |
319 storage_(path, fsyncOnWrite) | |
318 { | 320 { |
319 } | 321 } |
320 | 322 |
321 virtual void Create(const std::string& uuid, | 323 virtual void Create(const std::string& uuid, |
322 const void* content, | 324 const void* content, |
365 boost::filesystem::path storageDirectory = | 367 boost::filesystem::path storageDirectory = |
366 lock.GetConfiguration().InterpretStringParameterAsPath(storageDirectoryStr); | 368 lock.GetConfiguration().InterpretStringParameterAsPath(storageDirectoryStr); |
367 | 369 |
368 LOG(WARNING) << "Storage directory: " << storageDirectory; | 370 LOG(WARNING) << "Storage directory: " << storageDirectory; |
369 | 371 |
372 // New in Orthanc 1.7.4 | |
373 bool fsyncOnWrite = lock.GetConfiguration().GetBooleanParameter("SyncStorageArea", true); | |
374 | |
370 if (lock.GetConfiguration().GetBooleanParameter("StoreDicom", true)) | 375 if (lock.GetConfiguration().GetBooleanParameter("StoreDicom", true)) |
371 { | 376 { |
372 return new FilesystemStorage(storageDirectory.string()); | 377 return new FilesystemStorage(storageDirectory.string(), fsyncOnWrite); |
373 } | 378 } |
374 else | 379 else |
375 { | 380 { |
376 LOG(WARNING) << "The DICOM files will not be stored, Orthanc running in index-only mode"; | 381 LOG(WARNING) << "The DICOM files will not be stored, Orthanc running in index-only mode"; |
377 return new FilesystemStorageWithoutDicom(storageDirectory.string()); | 382 return new FilesystemStorageWithoutDicom(storageDirectory.string(), fsyncOnWrite); |
378 } | 383 } |
379 } | 384 } |
380 | 385 |
381 | 386 |
382 IDatabaseWrapper* CreateDatabaseWrapper() | 387 IDatabaseWrapper* CreateDatabaseWrapper() |