From fb29e45bd0e8f4e696c4c71f43adb3fd9690d1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 10 Dec 2018 20:49:21 +0100 Subject: NOISSUE make instance creation task abortable This may or may not expose issues when it actually IS used. --- api/logic/InstanceList.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'api') diff --git a/api/logic/InstanceList.cpp b/api/logic/InstanceList.cpp index e568211b..a3f2e487 100644 --- a/api/logic/InstanceList.cpp +++ b/api/logic/InstanceList.cpp @@ -714,6 +714,25 @@ public: virtual ~InstanceStaging() {}; + + // FIXME/TODO: add ability to abort during instance commit retries + bool abort() override + { + if(m_child) + { + return m_child->abort(); + } + return false; + } + bool canAbort() const override + { + if(m_child) + { + return m_child->canAbort(); + } + return false; + } + protected: virtual void executeTask() override { @@ -727,6 +746,7 @@ protected: private slots: void childSucceded() { + m_child.reset(); unsigned sleepTime = backoff(); if(m_parent->commitStagedInstance(m_stagingPath, m_instanceName, m_groupName)) { @@ -744,6 +764,7 @@ private slots: } void childFailed(const QString & reason) { + m_child.reset(); m_parent->destroyStagingPath(m_stagingPath); emitFailed(reason); } -- cgit v1.2.3