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:
parent
9171f471ab
commit
369a8cdc74
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue