diff OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp @ 4768:a046e91cc76f

cont fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Aug 2021 15:26:48 +0200
parents 1db3b79d97bd
children 0a38000b086d
line wrap: on
line diff
--- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp	Wed Aug 18 15:16:39 2021 +0200
+++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp	Wed Aug 18 15:26:48 2021 +0200
@@ -226,6 +226,11 @@
       return runtime_;
     }
 
+    void ResetRuntime()
+    {
+      runtime_ = boost::posix_time::milliseconds(0);
+    }
+
     const JobStatus& GetLastStatus() const
     {
       return lastStatus_;
@@ -1071,6 +1076,7 @@
       (void) ok;  // Remove warning about unused variable in release builds
       assert(ok);
 
+      found->second->ResetRuntime();
       found->second->SetState(JobState_Pending);
       pendingJobs_.push(found->second);
       pendingJobAvailable_.notify_one();