Mercurial > hg > orthanc
comparison OrthancServer/ServerJobs/LuaJobManager.cpp @ 2609:f7a84b551ee4 jobs
switch Lua to new jobs engine
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 19 May 2018 16:29:00 +0200 |
parents | 25225f0b4f33 |
children | 2f3007bf0708 |
comparison
equal
deleted
inserted
replaced
2608:25225f0b4f33 | 2609:f7a84b551ee4 |
---|---|
60 | 60 |
61 | 61 |
62 LuaJobManager::LuaJobManager() : | 62 LuaJobManager::LuaJobManager() : |
63 currentJob_(NULL), | 63 currentJob_(NULL), |
64 maxOperations_(1000), | 64 maxOperations_(1000), |
65 priority_(0) | 65 priority_(0), |
66 trailingTimeout_(5000) | |
66 { | 67 { |
67 } | 68 } |
68 | 69 |
69 | 70 |
70 void LuaJobManager::SetMaxOperationsPerJob(size_t count) | 71 void LuaJobManager::SetMaxOperationsPerJob(size_t count) |
116 | 117 |
117 if (isNewJob_) | 118 if (isNewJob_) |
118 { | 119 { |
119 // Need to create a new job, as the previous one is either | 120 // Need to create a new job, as the previous one is either |
120 // finished, or is getting too long | 121 // finished, or is getting too long |
121 that_.currentJob_ = new SequenceOfOperationsJob; | 122 that_.currentJob_ = new SequenceOfOperationsJob("Lua"); |
122 jobLock_.reset(new SequenceOfOperationsJob::Lock(*that_.currentJob_)); | 123 jobLock_.reset(new SequenceOfOperationsJob::Lock(*that_.currentJob_)); |
123 jobLock_->SetTrailingOperationTimeout(that_.trailingTimeout_); | 124 jobLock_->SetTrailingOperationTimeout(that_.trailingTimeout_); |
124 } | 125 } |
125 | 126 |
126 assert(jobLock_.get() != NULL); | 127 assert(jobLock_.get() != NULL); |