Skip to content

Commit

Permalink
fix: the canceled task would be Queued again
Browse files Browse the repository at this point in the history
If a task which is queued before has been canceled,
it should not be update to Queued.

Log:
  • Loading branch information
kamiyadm authored and dengbo11 committed Dec 10, 2024
1 parent 600c657 commit f58cd1f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions libs/linglong/src/linglong/package_manager/package_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ PackageManager::PackageManager(linglong::repo::OSTreeRepo &repo, QObject *parent
// notify task waiting
if (!this->runningTaskObjectPath.isEmpty()) {
for (auto *task : taskList) {
// skip tasks without job
if (!task->getJob().has_value()
|| task->taskObjectPath() == runningTaskObjectPath) {
continue;
if (task->getJob().has_value()
&& task->state() == linglong::api::types::v1::State::Queued) {
auto msg = QString("Waiting for the other tasks");
task->updateState(linglong::api::types::v1::State::Queued, msg);
}
auto msg = QString("Waiting for the other tasks");
task->updateState(linglong::api::types::v1::State::Queued, msg);
}
return;
}
Expand Down

0 comments on commit f58cd1f

Please sign in to comment.