diff OrthancServer/ServerContext.h @ 2950:dc18d5804746

support of JobsHistorySize set to zero
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Nov 2018 17:19:57 +0100
parents 4767d36679ed
children 9c0b0a6d8b54
line wrap: on
line diff
--- a/OrthancServer/ServerContext.h	Thu Nov 29 20:36:55 2018 +0100
+++ b/OrthancServer/ServerContext.h	Fri Nov 30 17:19:57 2018 +0100
@@ -160,12 +160,17 @@
     DicomCacheProvider provider_;
     boost::mutex dicomCacheMutex_;
     MemoryCache dicomCache_;
-    JobsEngine jobsEngine_;
 
     LuaScripting mainLua_;
     LuaScripting filterLua_;
     LuaServerListener  luaListener_;
 
+    // The "JobsEngine" must be *after* "LuaScripting", as
+    // "LuaScripting" embeds "LuaJobManager" that registers as an
+    // observer to "SequenceOfOperationsJob", whose lifetime
+    // corresponds to that of "JobsEngine"
+    JobsEngine jobsEngine_;
+    
 #if ORTHANC_ENABLE_PLUGINS == 1
     OrthancPlugins* plugins_;
 #endif
@@ -206,7 +211,8 @@
 
     ServerContext(IDatabaseWrapper& database,
                   IStorageArea& area,
-                  bool unitTesting);
+                  bool unitTesting,
+                  size_t maxCompletedJobs);
 
     ~ServerContext();