# HG changeset patch # User Sebastien Jodogne # Date 1423585045 -3600 # Node ID 8cd5784a6d80429ce26eaebfd6143cb076867fd5 # Parent 536515f87cb405be3d751d02ba740fbb28137a3e IDatabaseWrapper::HasFlushToDisk() diff -r 536515f87cb4 -r 8cd5784a6d80 OrthancServer/DatabaseWrapper.h --- a/OrthancServer/DatabaseWrapper.h Tue Feb 10 17:11:00 2015 +0100 +++ b/OrthancServer/DatabaseWrapper.h Tue Feb 10 17:17:25 2015 +0100 @@ -190,6 +190,11 @@ db_.FlushToDisk(); } + virtual bool HasFlushToDisk() const + { + return true; + } + virtual void ClearChanges() { ClearTable("Changes"); diff -r 536515f87cb4 -r 8cd5784a6d80 OrthancServer/IDatabaseWrapper.h --- a/OrthancServer/IDatabaseWrapper.h Tue Feb 10 17:11:00 2015 +0100 +++ b/OrthancServer/IDatabaseWrapper.h Tue Feb 10 17:17:25 2015 +0100 @@ -73,6 +73,8 @@ virtual void FlushToDisk() = 0; + virtual bool HasFlushToDisk() const = 0; + virtual void GetAllMetadata(std::map& target, int64_t id) = 0; diff -r 536515f87cb4 -r 8cd5784a6d80 OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Tue Feb 10 17:11:00 2015 +0100 +++ b/OrthancServer/ServerIndex.cpp Tue Feb 10 17:17:25 2015 +0100 @@ -553,7 +553,11 @@ // execution of Orthanc StandaloneRecycling(); - flushThread_ = boost::thread(FlushThread, this); + if (db.HasFlushToDisk()) + { + flushThread_ = boost::thread(FlushThread, this); + } + unstableResourcesMonitorThread_ = boost::thread(UnstableResourcesMonitorThread, this); } @@ -562,7 +566,8 @@ { done_ = true; - if (flushThread_.joinable()) + if (db_.HasFlushToDisk() && + flushThread_.joinable()) { flushThread_.join(); }