# HG changeset patch # User Sebastien Jodogne # Date 1776095160 -7200 # Node ID acb33120930917b8ee9c537c97e0529d470eae20 # Parent f7ba463e9f9f82471436445e0a9bae196ac5cd34# Parent 7b1fe82d3ce1873f2610be84256ddde351f8b155 merge diff -r f7ba463e9f9f -r acb331209309 OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp --- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Mon Apr 13 17:45:15 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Mon Apr 13 17:46:00 2026 +0200 @@ -800,7 +800,8 @@ void JobsRegistry::SubmitInternal(std::string& id, - JobHandler* handler) + JobHandler* handler, + bool fromSerialization) { if (handler == NULL) { @@ -851,7 +852,14 @@ std::string jobType; handler->GetJob().GetJobType(jobType); - LOG(INFO) << "New " << jobType << " job submitted with priority " << priority << ": " << id; + if (fromSerialization) + { + LOG(INFO) << "Loaded " << jobType << " job (" << EnumerationToString(handler->GetState()) << ") with priority " << priority << ": " << id; + } + else + { + LOG(INFO) << "New " << jobType << " job submitted with priority " << priority << ": " << id; + } if (observer_ != NULL) { @@ -876,7 +884,7 @@ IJob* job, // Takes ownership int priority) { - SubmitInternal(id, new JobHandler(job, priority)); + SubmitInternal(id, new JobHandler(job, priority), false); } @@ -884,7 +892,7 @@ int priority) { std::string id; - SubmitInternal(id, new JobHandler(job, priority)); + SubmitInternal(id, new JobHandler(job, priority), false); } @@ -1614,7 +1622,7 @@ const boost::posix_time::ptime lastChangeTime = job->GetLastStateChangeTime(); std::string id; - SubmitInternal(id, job.release()); + SubmitInternal(id, job.release(), true); // Check whether the job has not been removed (which could be // the case if the "maxCompletedJobs_" value gets smaller) diff -r f7ba463e9f9f -r acb331209309 OrthancFramework/Sources/JobsEngine/JobsRegistry.h --- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.h Mon Apr 13 17:45:15 2026 +0200 +++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.h Mon Apr 13 17:46:00 2026 +0200 @@ -130,7 +130,8 @@ void RemoveRetryJob(JobHandler* handler); void SubmitInternal(std::string& id, - JobHandler* handler); + JobHandler* handler, + bool fromSerialization); public: explicit JobsRegistry(size_t maxCompletedJobs); diff -r f7ba463e9f9f -r acb331209309 OrthancServer/Sources/ServerJobs/StoreJob.cpp --- a/OrthancServer/Sources/ServerJobs/StoreJob.cpp Mon Apr 13 17:45:15 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/StoreJob.cpp Mon Apr 13 17:46:00 2026 +0200 @@ -92,7 +92,8 @@ instancesLoader_.reset(new ThreadedInstancesLoader(context_, loaderThreads, false, DicomTransferSyntax_LittleEndianImplicit /* dummy value not used*/, 0, GetLoaderPrefix())); - for (size_t i = 0; i < instancesIds_.size(); ++i) + size_t position = GetPosition(); // in case we reload a job in progress, we shall not preload the first instances + for (size_t i = position; i < instancesIds_.size(); ++i) { instancesLoader_->PreloadDicomInstance(instancesIds_[i], filesInfo_[i]); } diff -r f7ba463e9f9f -r acb331209309 OrthancServer/Sources/ServerJobs/ThreadedInstancesLoader.cpp --- a/OrthancServer/Sources/ServerJobs/ThreadedInstancesLoader.cpp Mon Apr 13 17:45:15 2026 +0200 +++ b/OrthancServer/Sources/ServerJobs/ThreadedInstancesLoader.cpp Mon Apr 13 17:46:00 2026 +0200 @@ -167,6 +167,7 @@ } const std::string& instanceId = instanceToPreload->GetId(); + LOG(INFO) << "Loader thread is loading instance " << instanceId; try {