mirror of
https://github.com/Zygo/bees.git
synced 2025-07-06 18:32:26 +02:00
roots: if queue is full run again
The task queue may already be full of tasks when the crawl task is executed. In this case simply reschedule the crawl task at the end of the current queue. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -380,13 +380,10 @@ BeesRoots::crawl_thread()
|
|||||||
m_crawl_task = Task("crawl_master", [shared_this]() {
|
m_crawl_task = Task("crawl_master", [shared_this]() {
|
||||||
auto tqs = TaskMaster::get_queue_count();
|
auto tqs = TaskMaster::get_queue_count();
|
||||||
BEESNOTE("queueing extents to scan, " << tqs << " of " << BEES_MAX_QUEUE_SIZE);
|
BEESNOTE("queueing extents to scan, " << tqs << " of " << BEES_MAX_QUEUE_SIZE);
|
||||||
bool run_again = false;
|
bool run_again = true;
|
||||||
while (tqs < BEES_MAX_QUEUE_SIZE) {
|
while (tqs < BEES_MAX_QUEUE_SIZE && run_again) {
|
||||||
run_again = shared_this->crawl_roots();
|
run_again = shared_this->crawl_roots();
|
||||||
tqs = TaskMaster::get_queue_count();
|
tqs = TaskMaster::get_queue_count();
|
||||||
if (!run_again) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (run_again) {
|
if (run_again) {
|
||||||
shared_this->m_crawl_task.run();
|
shared_this->m_crawl_task.run();
|
||||||
|
Reference in New Issue
Block a user