comparison OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp @ 5310:b5c502bcaf99

added a route to DELETE /jobs/../archive
author Alain Mazy <am@osimis.io>
date Mon, 12 Jun 2023 18:42:06 +0200
parents 0ea402b4d901
children b5f2122a1334
comparison
equal deleted inserted replaced
5309:fb231da5c0f1 5310:b5c502bcaf99
669 const JobHandler& handler = *found->second; 669 const JobHandler& handler = *found->second;
670 670
671 if (handler.GetState() == JobState_Success) 671 if (handler.GetState() == JobState_Success)
672 { 672 {
673 return handler.GetJob().GetOutput(output, mime, filename, key); 673 return handler.GetJob().GetOutput(output, mime, filename, key);
674 }
675 else
676 {
677 return false;
678 }
679 }
680 }
681
682 bool JobsRegistry::DeleteJobOutput(const std::string& job,
683 const std::string& key)
684 {
685 boost::mutex::scoped_lock lock(mutex_);
686 CheckInvariants();
687
688 JobsIndex::const_iterator found = jobsIndex_.find(job);
689
690 if (found == jobsIndex_.end())
691 {
692 return false;
693 }
694 else
695 {
696 const JobHandler& handler = *found->second;
697
698 if (handler.GetState() == JobState_Success)
699 {
700 return handler.GetJob().DeleteOutput(key);
674 } 701 }
675 else 702 else
676 { 703 {
677 return false; 704 return false;
678 } 705 }