From 369a8cdc7497d7bc335b660ac6c14652abe8fde7 Mon Sep 17 00:00:00 2001 From: flow Date: Fri, 22 Jul 2022 00:28:08 -0300 Subject: fix: only try to start tasks that are really there This fixes an annoying issue where concurrent tasks would try to start multiple tasks even when there was not that many tasks to run in the first place, causing some amount of log spam. Signed-off-by: flow --- launcher/tasks/ConcurrentTask.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'launcher/tasks/ConcurrentTask.cpp') diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index ab7cbd03..2af296b9 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -37,7 +37,8 @@ void ConcurrentTask::executeTask() { m_total_size = m_queue.size(); - for (int i = 0; i < m_total_max_size; i++) { + int num_starts = std::min(m_total_max_size, m_total_size); + for (int i = 0; i < num_starts; i++) { QMetaObject::invokeMethod(this, &ConcurrentTask::startNext, Qt::QueuedConnection); } } -- cgit