diff OrthancServer/OrthancRestApi/OrthancRestSystem.cpp @ 2616:2f3007bf0708 jobs

event queues in Lua, serialization of sequence of operations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 May 2018 12:25:37 +0200
parents 6f9225dcfc32
children 912a767911b0
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Mon May 21 09:00:20 2018 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Tue May 22 12:25:37 2018 +0200
@@ -124,8 +124,8 @@
     call.BodyToString(command);
 
     {
-      LuaScripting::Locker locker(context.GetLuaScripting());
-      locker.GetLua().Execute(result, command);
+      LuaScripting::Lock lock(context.GetLuaEventHandler());
+      lock.GetLua().Execute(result, command);
     }
 
     call.GetOutput().AnswerBuffer(result, "text/plain");
@@ -276,6 +276,7 @@
   static void ListJobs(RestApiGetCall& call)
   {
     bool expand = call.HasArgument("expand");
+    bool internal = call.HasArgument("internal");
 
     Json::Value v = Json::arrayValue;
 
@@ -291,7 +292,7 @@
         if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, *it))
         {
           Json::Value tmp;
-          info.Serialize(tmp, false);
+          info.Serialize(tmp, internal);
           v.append(tmp);
         }
       }
@@ -307,12 +308,13 @@
   static void GetJobInfo(RestApiGetCall& call)
   {
     std::string id = call.GetUriComponent("id", "");
+    bool internal = call.HasArgument("internal");
 
     JobInfo info;
     if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, id))
     {
       Json::Value json;
-      info.Serialize(json, false);
+      info.Serialize(json, internal);
       call.GetOutput().AnswerJson(json);
     }
   }