changeset 6729:8d3fda9b6470

fix resubmit for StoreJob
author Alain Mazy <am@orthanc.team>
date Tue, 21 Apr 2026 11:27:20 +0200
parents fa2ad46c9af3
children c225552d8824
files NEWS OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp OrthancServer/Sources/ServerJobs/StoreJob.cpp OrthancServer/Sources/ServerJobs/StoreJob.h
diffstat 4 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Apr 20 19:56:19 2026 +0200
+++ b/NEWS	Tue Apr 21 11:27:20 2026 +0200
@@ -25,6 +25,8 @@
 Maintenance
 -----------
 
+* Fix /jobs/.../resubmit for OrthancPeerStore and DicomModalityStore jobs 
+  (bug introduced in 1.12.10)
 * Fix Orthanc::ImageAccessor that was broken in Orthanc Framework 1.12.11
 
 
--- a/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp	Mon Apr 20 19:56:19 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp	Tue Apr 21 11:27:20 2026 +0200
@@ -224,7 +224,7 @@
 
   void DicomModalityStoreJob::Reset()
   {
-    SetOfInstancesJob::Reset();
+    StoreJob::Reset();
 
     /**
      * "After the N-EVENT-REPORT has been sent, the Transaction UID is
--- a/OrthancServer/Sources/ServerJobs/StoreJob.cpp	Mon Apr 20 19:56:19 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/StoreJob.cpp	Tue Apr 21 11:27:20 2026 +0200
@@ -81,6 +81,14 @@
     }
   }
 
+  void StoreJob::Reset()  // called in case of "resubmit"
+  {
+    SetOfInstancesJob::Reset();
+    
+    // restart the loader threads here (this can happen quite long before the job starts actually being executed but this is the only place where we can do this)
+    Start();
+  }
+
 
   void StoreJob::Start()
   {
--- a/OrthancServer/Sources/ServerJobs/StoreJob.h	Mon Apr 20 19:56:19 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/StoreJob.h	Tue Apr 21 11:27:20 2026 +0200
@@ -50,6 +50,8 @@
     StoreJob(ServerContext& context,
              const Json::Value& serialized);
 
+    virtual void Reset() ORTHANC_OVERRIDE;
+    
     virtual void Start() ORTHANC_OVERRIDE;
 
     virtual void Stop(JobStopReason reason) ORTHANC_OVERRIDE;