logic: reduced waiting time when interrupting indexer processes

* made multiprocess AST traversal interruptible again
* removed const variables that define sleep times for threads
This commit is contained in:
mlangkabel
2018-09-21 17:19:03 +02:00
parent 593e075399
commit 951256c07b
44 changed files with 244 additions and 187 deletions
+6 -4
View File
@@ -41,6 +41,8 @@ TaskBuildIndex::TaskBuildIndex(
void TaskBuildIndex::doEnter(std::shared_ptr<Blackboard> blackboard)
{
m_interprocessIndexingStatusManager.setIndexingInterrupted(false);
m_indexingFileCount = 0;
updateIndexingDialog(blackboard, std::vector<FilePath>());
@@ -104,8 +106,7 @@ Task::TaskState TaskBuildIndex::doUpdate(std::shared_ptr<Blackboard> blackboard)
updateIndexingDialog(blackboard, std::vector<FilePath>());
}
const int SLEEP_TIME_MS = 50;
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME_MS));
std::this_thread::sleep_for(std::chrono::milliseconds(50));
return STATE_RUNNING;
}
@@ -154,6 +155,8 @@ void TaskBuildIndex::handleMessage(MessageInterruptTasks* message)
{
if (!m_dialogView->dialogsHidden())
{
LOG_INFO("sending indexer interrupt command.");
m_interprocessIndexingStatusManager.setIndexingInterrupted(true);
m_interrupted = true;
}
}
@@ -232,8 +235,7 @@ bool TaskBuildIndex::fetchIntermediateStorages(std::shared_ptr<Blackboard> black
{
LOG_INFO_STREAM(<< "waiting, too many storages queued: " << providerStorageCount);
const int SLEEP_TIME_MS = 100;
std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME_MS));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
return true;
}