aboutsummaryrefslogtreecommitdiff
path: root/mod/ci-common.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'mod/ci-common.hxx')
-rw-r--r--mod/ci-common.hxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/mod/ci-common.hxx b/mod/ci-common.hxx
index f332dc2..848bca1 100644
--- a/mod/ci-common.hxx
+++ b/mod/ci-common.hxx
@@ -98,16 +98,32 @@ namespace brep
tenant_service&&,
const repository_location& repository) const;
- // Abandon previously created (as unloaded) CI request.
+ // Cancel previously created or started CI request. Return the service
+ // state or nullopt if there is no tenant for such a type/id pair.
//
// Note: should be called out of the database transaction.
//
- void
- abandon (const basic_mark& error,
- const basic_mark& warn,
- const basic_mark* trace,
- odb::core::database&,
- tenant_service&&) const;
+ optional<tenant_service>
+ cancel (const basic_mark& error,
+ const basic_mark& warn,
+ const basic_mark* trace,
+ odb::core::database&,
+ const string& type,
+ const string& id) const;
+
+ // Cancel previously created or started CI request. Return false if there
+ // is no tenant for the specified tenant id. Note that the reason argument
+ // is only used for tracing.
+ //
+ // Note: should be called out of the database transaction.
+ //
+ bool
+ cancel (const basic_mark& error,
+ const basic_mark& warn,
+ const basic_mark* trace,
+ const string& reason,
+ odb::core::database&,
+ const string& tenant_id) const;
// Helpers.
//
@@ -120,22 +136,6 @@ namespace brep
private:
shared_ptr<options::ci_start> options_;
};
-
- class ci_cancel
- {
- public:
- void
- init (shared_ptr<options::ci_cancel>, shared_ptr<odb::core::database>);
-
- // @@ TODO Archive the tenant.
- //
- void
- cancel (/*...*/);
-
- private:
- shared_ptr<options::ci_cancel> options_;
- shared_ptr<odb::core::database> build_db_;
- };
}
#endif // MOD_CI_COMMON_HXX