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 {
|
try {
|
||||||
state->_lastJobStarted = clock::now();
|
state->_lastJobStarted = clock::now();
|
||||||
state->_working = true;
|
state->_working = true;
|
||||||
work->_handler();
|
(*work.get())();
|
||||||
state->_working = false;
|
state->_working = false;
|
||||||
} catch (std::exception const& ex) {
|
} catch (std::exception const& ex) {
|
||||||
LOG_TOPIC("a235e", ERR, Logger::THREADS)
|
LOG_TOPIC("a235e", ERR, Logger::THREADS)
|
||||||
|
|
|
@ -66,10 +66,12 @@ class SupervisedScheduler final : public Scheduler {
|
||||||
friend class SupervisedSchedulerWorkerThread;
|
friend class SupervisedSchedulerWorkerThread;
|
||||||
|
|
||||||
struct WorkItem final {
|
struct WorkItem final {
|
||||||
|
private:
|
||||||
std::function<void()> _handler;
|
std::function<void()> _handler;
|
||||||
double _startTime;
|
double _startTime;
|
||||||
bool _called;
|
bool _called;
|
||||||
|
|
||||||
|
public:
|
||||||
explicit WorkItem(std::function<void()> const& handler)
|
explicit WorkItem(std::function<void()> const& handler)
|
||||||
: _handler(handler), _startTime(TRI_microtime()), _called(false) {}
|
: _handler(handler), _startTime(TRI_microtime()), _called(false) {}
|
||||||
explicit WorkItem(std::function<void()>&& handler)
|
explicit WorkItem(std::function<void()>&& handler)
|
||||||
|
@ -83,7 +85,12 @@ class SupervisedScheduler final : public Scheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkItem(WorkItem const& other) = delete;
|
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()() {
|
void operator()() {
|
||||||
_called = true;
|
_called = true;
|
||||||
|
|
Loading…
Reference in New Issue