changeset 783:c9cdd53a6b31 lua-scripting

main scheduler added to the server context
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Apr 2014 18:36:20 +0200
parents f0ac3a53ccf2
children 394a19d44f9d
files OrthancServer/Scheduler/ServerScheduler.cpp OrthancServer/ServerContext.h
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Scheduler/ServerScheduler.cpp	Wed Apr 30 18:30:05 2014 +0200
+++ b/OrthancServer/Scheduler/ServerScheduler.cpp	Wed Apr 30 18:36:20 2014 +0200
@@ -132,6 +132,8 @@
   {
     static const int32_t TIMEOUT = 100;
 
+    LOG(WARNING) << "The server scheduler has started";
+
     while (!that->finish_)
     {
       std::auto_ptr<IDynamicObject> object(that->queue_.Dequeue(TIMEOUT));
--- a/OrthancServer/ServerContext.h	Wed Apr 30 18:30:05 2014 +0200
+++ b/OrthancServer/ServerContext.h	Wed Apr 30 18:36:20 2014 +0200
@@ -40,6 +40,7 @@
 #include "ServerIndex.h"
 #include "FromDcmtkBridge.h"
 #include "DicomProtocol/ReusableDicomUserConnection.h"
+#include "Scheduler/ServerScheduler.h"
 
 namespace Orthanc
 {
@@ -72,6 +73,7 @@
     DicomCacheProvider provider_;
     MemoryCache dicomCache_;
     ReusableDicomUserConnection scu_;
+    ServerScheduler scheduler_;
 
     LuaContext lua_;
 
@@ -157,5 +159,10 @@
     {
       return scu_;
     }
+
+    ServerScheduler& GetScheduler()
+    {
+      return scheduler_;
+    }
   };
 }