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 <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-07-22 00:28:08 -03:00
parent 9171f471ab
commit 369a8cdc74
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469

View File

@ -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);
}
}