Skip to content

Commit

Permalink
fix: install app failed after it was cancled before
Browse files Browse the repository at this point in the history
The job which the state is not Queued or has no job should be remove.

Log:
  • Loading branch information
kamiyadm committed Dec 18, 2024
1 parent bbd5df5 commit 247705b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,13 @@ PackageManager::PackageManager(linglong::repo::OSTreeRepo &repo,
return;
}

for (auto it = taskList.begin(); it != taskList.end(); ++it) {
for (auto it = taskList.begin(); it != taskList.end();) {
auto *task = *it;
if (!task->getJob().has_value()
|| task->state() != linglong::api::types::v1::State::Queued) {
qInfo() << "Remove" << task->taskID()
<< "from task queue, it has no job or State not Queued";
this->taskList.erase(it);
continue;
}
this->runningTaskObjectPath = task->taskObjectPath();
Expand Down

0 comments on commit 247705b

Please sign in to comment.