comparison OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp @ 5130:f2dcdbe05884

ResourceModification jobs can now use multiple threads
author Alain Mazy <am@osimis.io>
date Thu, 05 Jan 2023 17:24:43 +0100
parents 8422e4f99a18
children 0ea402b4d901
comparison
equal deleted inserted replaced
5128:ede035d48b8e 5130:f2dcdbe05884
432 } 432 }
433 433
434 SubmitGenericJob(call, raii.release(), isDefaultSynchronous, body); 434 SubmitGenericJob(call, raii.release(), isDefaultSynchronous, body);
435 } 435 }
436 436
437 437 void OrthancRestApi::SubmitThreadedInstancesJob(RestApiPostCall& call,
438 ThreadedSetOfInstancesJob* job,
439 bool isDefaultSynchronous,
440 const Json::Value& body) const
441 {
442 std::unique_ptr<ThreadedSetOfInstancesJob> raii(job);
443
444 if (body.type() != Json::objectValue)
445 {
446 throw OrthancException(ErrorCode_BadFileFormat);
447 }
448
449 job->SetDescription("REST API");
450
451 if (body.isMember(KEY_PERMISSIVE))
452 {
453 job->SetPermissive(SerializationToolbox::ReadBoolean(body, KEY_PERMISSIVE));
454 }
455 else
456 {
457 job->SetPermissive(false);
458 }
459
460 SubmitGenericJob(call, raii.release(), isDefaultSynchronous, body);
461 }
462
438 void OrthancRestApi::DocumentSubmitGenericJob(RestApiPostCall& call) 463 void OrthancRestApi::DocumentSubmitGenericJob(RestApiPostCall& call)
439 { 464 {
440 call.GetDocumentation() 465 call.GetDocumentation()
441 .SetRequestField(KEY_SYNCHRONOUS, RestApiCallDocumentation::Type_Boolean, 466 .SetRequestField(KEY_SYNCHRONOUS, RestApiCallDocumentation::Type_Boolean,
442 "If `true`, run the job in synchronous mode, which means that the HTTP answer will directly " 467 "If `true`, run the job in synchronous mode, which means that the HTTP answer will directly "