From a7ae434c48c14bfde46a871455a3aa2ac0b81376 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 26 May 2024 13:46:55 +0300 Subject: Add CI cancel handler --- mod/ci-common.hxx | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'mod/ci-common.hxx') diff --git a/mod/ci-common.hxx b/mod/ci-common.hxx index 8efeb26..848bca1 100644 --- a/mod/ci-common.hxx +++ b/mod/ci-common.hxx @@ -111,6 +111,20 @@ namespace brep 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. // @@ -122,22 +136,6 @@ namespace brep private: shared_ptr options_; }; - - class ci_cancel - { - public: - void - init (shared_ptr, shared_ptr); - - // @@ TODO Archive the tenant. - // - void - cancel (/*...*/); - - private: - shared_ptr options_; - shared_ptr build_db_; - }; } #endif // MOD_CI_COMMON_HXX -- cgit v1.1