comparison OrthancServer/Sources/main.cpp @ 5061:e95fadefeb72

new MaximumStorageMode configuration
author Alain Mazy <am@osimis.io>
date Tue, 09 Aug 2022 17:57:38 +0200
parents e1495a34cd39
children bdec57f3cbf2
comparison
equal deleted inserted replaced
5060:e69a3ff39bc5 5061:e95fadefeb72
41 #include "OrthancGetRequestHandler.h" 41 #include "OrthancGetRequestHandler.h"
42 #include "OrthancInitialization.h" 42 #include "OrthancInitialization.h"
43 #include "OrthancMoveRequestHandler.h" 43 #include "OrthancMoveRequestHandler.h"
44 #include "OrthancWebDav.h" 44 #include "OrthancWebDav.h"
45 #include "ServerContext.h" 45 #include "ServerContext.h"
46 #include "ServerEnumerations.h"
46 #include "ServerJobs/StorageCommitmentScpJob.h" 47 #include "ServerJobs/StorageCommitmentScpJob.h"
47 #include "ServerToolbox.h" 48 #include "ServerToolbox.h"
48 #include "StorageCommitmentReports.h" 49 #include "StorageCommitmentReports.h"
49 50
50 #include <boost/algorithm/string/predicate.hpp> 51 #include <boost/algorithm/string/predicate.hpp>
1562 context.GetIndex().SetMaximumStorageSize(0); 1563 context.GetIndex().SetMaximumStorageSize(0);
1563 } 1564 }
1564 1565
1565 try 1566 try
1566 { 1567 {
1568 std::string mode = lock.GetConfiguration().GetStringParameter("MaximumStorageMode", "Recycle");
1569 context.GetIndex().SetMaximumStorageMode(StringToMaxStorageMode(mode));
1570 }
1571 catch (...)
1572 {
1573 context.GetIndex().SetMaximumStorageMode(MaxStorageMode_Recycle);
1574 }
1575
1576 try
1577 {
1567 uint64_t size = lock.GetConfiguration().GetUnsignedIntegerParameter("MaximumStorageCacheSize", 128); 1578 uint64_t size = lock.GetConfiguration().GetUnsignedIntegerParameter("MaximumStorageCacheSize", 128);
1568 context.SetMaximumStorageCacheSize(size * 1024 * 1024); 1579 context.SetMaximumStorageCacheSize(size * 1024 * 1024);
1569 } 1580 }
1570 catch (...) 1581 catch (...)
1571 { 1582 {