mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api
This commit is contained in:
commit
5c0110070f
|
@ -242,14 +242,13 @@ bool GeneralCommTask::handleRequestAsync(std::shared_ptr<RestHandler> handler,
|
||||||
size_t queue = handler->queue();
|
size_t queue = handler->queue();
|
||||||
auto self = shared_from_this();
|
auto self = shared_from_this();
|
||||||
|
|
||||||
std::unique_ptr<Job> job(
|
auto job = std::make_unique<Job>(_server, std::move(handler),
|
||||||
new Job(_server, std::move(handler),
|
|
||||||
[self, this](std::shared_ptr<RestHandler> h) {
|
[self, this](std::shared_ptr<RestHandler> h) {
|
||||||
JobGuard guard(_loop);
|
JobGuard guard(_loop);
|
||||||
guard.work();
|
guard.work();
|
||||||
|
|
||||||
h->asyncRunEngine();
|
h->asyncRunEngine();
|
||||||
}));
|
});
|
||||||
|
|
||||||
return SchedulerFeature::SCHEDULER->jobQueue()->queue(queue, std::move(job));
|
return SchedulerFeature::SCHEDULER->jobQueue()->queue(queue, std::move(job));
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,14 @@ class JobQueueThread final : public Thread {
|
||||||
_jobQueue->waitForWork();
|
_jobQueue->waitForWork();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear all non-processed jobs
|
||||||
|
for (size_t i = 0; i < JobQueue::SYSTEM_QUEUE_SIZE; ++i) {
|
||||||
|
Job* job = nullptr;
|
||||||
|
while (_jobQueue->pop(i, job)) {
|
||||||
|
delete job;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue