mirror of https://gitee.com/bigwinds/arangodb
MORE Debug logging
This commit is contained in:
parent
6134b664bd
commit
dab5af28c0
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue