1
0
Fork 0

MORE Debug logging

This commit is contained in:
Michael Hackstein 2019-07-08 13:56:50 +02:00
parent 6134b664bd
commit dab5af28c0
2 changed files with 9 additions and 2 deletions

View File

@ -247,7 +247,7 @@ void SupervisedScheduler::runWorker() {
try {
state->_lastJobStarted = clock::now();
state->_working = true;
work->_handler();
(*work.get())();
state->_working = false;
} catch (std::exception const& ex) {
LOG_TOPIC("a235e", ERR, Logger::THREADS)

View File

@ -66,10 +66,12 @@ class SupervisedScheduler final : public Scheduler {
friend class SupervisedSchedulerWorkerThread;
struct WorkItem final {
private:
std::function<void()> _handler;
double _startTime;
bool _called;
public:
explicit WorkItem(std::function<void()> const& handler)
: _handler(handler), _startTime(TRI_microtime()), _called(false) {}
explicit WorkItem(std::function<void()>&& handler)
@ -83,7 +85,12 @@ class SupervisedScheduler final : public Scheduler {
}
WorkItem(WorkItem const& other) = delete;
WorkItem(WorkItem && other) = default;
WorkItem(WorkItem&& other) {
_handler = std::move(other._handler);
_startTime = other._startTime;
_called = other._called;
other._called = false;
}
void operator()() {
_called = true;