Mercurial > hg > orthanc
diff Core/JobsEngine/JobsRegistry.h @ 2950:dc18d5804746
support of JobsHistorySize set to zero
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 30 Nov 2018 17:19:57 +0100 |
parents | 251614c2edac |
children | cb5d75143da0 |
line wrap: on
line diff
--- a/Core/JobsEngine/JobsRegistry.h Thu Nov 29 20:36:55 2018 +0100 +++ b/Core/JobsEngine/JobsRegistry.h Fri Nov 30 17:19:57 2018 +0100 @@ -71,6 +71,13 @@ }; private: + enum CompletedReason + { + CompletedReason_Success, + CompletedReason_Failure, + CompletedReason_Canceled + }; + class JobHandler; struct PriorityComparator @@ -115,7 +122,7 @@ bool success); void MarkRunningAsCompleted(JobHandler& job, - bool success); + CompletedReason reason); void MarkRunningAsRetry(JobHandler& job, unsigned int timeout); @@ -130,23 +137,25 @@ void RemoveRetryJob(JobHandler* handler); void SubmitInternal(std::string& id, - JobHandler* handler, - bool keepLastChangeTime); + JobHandler* handler); public: - JobsRegistry() : - maxCompletedJobs_(10), + JobsRegistry(size_t maxCompletedJobs) : + maxCompletedJobs_(maxCompletedJobs), observer_(NULL) { } JobsRegistry(IJobUnserializer& unserializer, - const Json::Value& s); + const Json::Value& s, + size_t maxCompletedJobs); ~JobsRegistry(); void SetMaxCompletedJobs(size_t i); + size_t GetMaxCompletedJobs(); + void ListJobs(std::set<std::string>& target); bool GetJobInfo(JobInfo& target,