# HG changeset patch # User Sebastien Jodogne # Date 1548350653 -3600 # Node ID 1fe524e211af9018d53235406d10c6dcff2ebbb2 # Parent b79ec21747a155770756129039cd5ea07c3e421e New configuration option: "SaveJobs" to specify whether jobs are stored in the database diff -r b79ec21747a1 -r 1fe524e211af NEWS --- a/NEWS Thu Jan 24 18:06:13 2019 +0100 +++ b/NEWS Thu Jan 24 18:24:13 2019 +0100 @@ -1,6 +1,14 @@ Pending changes in the mainline =============================== +General +------- + +* New configuration option: "SaveJobs" to specify whether jobs are stored in the database + +Maintenance +----------- + * Don't return tags whose group is below 0x0008 in C-FIND SCP answers * Fix compatibility with DICOMweb plugin (allow multipart answers over HTTP Keep-Alive) * Fix issue #90 (C-Find shall match missing tags to null/empty string) diff -r b79ec21747a1 -r 1fe524e211af OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Thu Jan 24 18:06:13 2019 +0100 +++ b/OrthancServer/ServerContext.cpp Thu Jan 24 18:24:13 2019 +0100 @@ -196,21 +196,24 @@ void ServerContext::SaveJobsEngine() { - VLOG(1) << "Serializing the content of the jobs engine"; + if (saveJobs_) + { + VLOG(1) << "Serializing the content of the jobs engine"; - try - { - Json::Value value; - jobsEngine_.GetRegistry().Serialize(value); + try + { + Json::Value value; + jobsEngine_.GetRegistry().Serialize(value); - Json::FastWriter writer; - std::string serialized = writer.write(value); + Json::FastWriter writer; + std::string serialized = writer.write(value); - index_.SetGlobalProperty(GlobalProperty_JobsRegistry, serialized); - } - catch (OrthancException& e) - { - LOG(ERROR) << "Cannot serialize the jobs engine: " << e.What(); + index_.SetGlobalProperty(GlobalProperty_JobsRegistry, serialized); + } + catch (OrthancException& e) + { + LOG(ERROR) << "Cannot serialize the jobs engine: " << e.What(); + } } } @@ -245,6 +248,7 @@ new SharedArchive(lock.GetConfiguration().GetUnsignedIntegerParameter("MediaArchiveSize", 1))); defaultLocalAet_ = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); jobsEngine_.SetWorkersCount(lock.GetConfiguration().GetUnsignedIntegerParameter("ConcurrentJobs", 2)); + saveJobs_ = lock.GetConfiguration().GetBooleanParameter("SaveJobs", true); } jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); diff -r b79ec21747a1 -r 1fe524e211af OrthancServer/ServerContext.h --- a/OrthancServer/ServerContext.h Thu Jan 24 18:06:13 2019 +0100 +++ b/OrthancServer/ServerContext.h Thu Jan 24 18:24:13 2019 +0100 @@ -216,6 +216,7 @@ std::auto_ptr queryRetrieveArchive_; std::string defaultLocalAet_; OrthancHttpHandler httpHandler_; + bool saveJobs_; public: class DicomCacheLocker : public boost::noncopyable diff -r b79ec21747a1 -r 1fe524e211af Resources/Configuration.json --- a/Resources/Configuration.json Thu Jan 24 18:06:13 2019 +0100 +++ b/Resources/Configuration.json Thu Jan 24 18:24:13 2019 +0100 @@ -443,6 +443,15 @@ // REST API) and should be avoided for non-developers. "JobsHistorySize" : 10, + // Whether to save the jobs into the Orthanc database. If this + // option is set to "true", the pending/running/completed jobs are + // automatically reloaded from the database if Orthanc is stopped + // then restarted (except if the "--no-jobs" command-line argument + // is specified). This option should be set to "false" if multiple + // Orthanc servers are using the same database (e.g. if PostgreSQL + // or MariaDB/MySQL is used). + "SaveJobs" : true, + // Specifies how Orthanc reacts when it receives a DICOM instance // whose SOPInstanceUID is already stored. If set to "true", the new // instance replaces the old one. If set to "false", the new