From 656b96fde2f28d4e6866180174c4e8481a358624 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Thu, 24 Oct 2024 09:25:59 +0200 Subject: Handle check suite rebuilds (all checks) on a commit and/or PR --- mod/ci-common.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mod/ci-common.cxx') diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx index 11d55af..5b039ef 100644 --- a/mod/ci-common.cxx +++ b/mod/ci-common.cxx @@ -856,4 +856,30 @@ namespace brep return s; } + + optional ci_start:: + find (odb::core::database& db, + const string& type, + const string& id) const + { + using namespace odb::core; + + assert (!transaction::has_current ()); + + transaction tr (db.begin ()); + + using query = query; + + shared_ptr t ( + db.query_one (query::service.id == id && + query::service.type == type)); + + tr.commit (); + + optional r; + if (t != nullptr) + r = move (t->service); + + return r; + } } -- cgit v1.1