fix: some abort-related issues

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-08-05 21:25:21 -03:00
parent eda6cf11ef
commit 2dd372600c
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
4 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,8 @@ InstanceCreationTask::InstanceCreationTask() = default;
void InstanceCreationTask::executeTask()
{
setAbortStatus(true);
if (updateInstance()) {
emitSucceeded();
return;

View File

@ -796,10 +796,12 @@ class InstanceStaging : public Task {
// FIXME/TODO: add ability to abort during instance commit retries
bool abort() override
{
if (m_child && m_child->canAbort())
return m_child->abort();
if (!canAbort())
return false;
return false;
m_child->abort();
return Task::abort();
}
bool canAbort() const override
{

View File

@ -30,6 +30,7 @@ bool FlameCreationTask::abort()
if (!canAbort())
return false;
m_abort = true;
if (m_process_update_file_info_job)
m_process_update_file_info_job->abort();
if (m_files_job)

View File

@ -22,8 +22,9 @@ bool ModrinthCreationTask::abort()
if (!canAbort())
return false;
m_abort = true;
if (m_files_job)
return m_files_job->abort();
m_files_job->abort();
return Task::abort();
}