From f845f18af3d3c18cbfb09ebfecac81bdb3c91953 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Nov 2024 09:07:00 +0200 Subject: Return tenant archived indication from ci_start::find() --- mod/ci-common.cxx | 9 ++++----- mod/ci-common.hxx | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx index cc361d2..4b9f9f9 100644 --- a/mod/ci-common.cxx +++ b/mod/ci-common.cxx @@ -988,7 +988,7 @@ namespace brep return s; } - optional ci_start:: + optional> ci_start:: find (odb::core::database& db, const string& type, const string& id) const @@ -1007,10 +1007,9 @@ namespace brep tr.commit (); - optional r; - if (t != nullptr) - r = move (t->service); + if (t == nullptr || !t->service) + return nullopt; - return r; + return pair (move (*t->service), t->archived); } } diff --git a/mod/ci-common.hxx b/mod/ci-common.hxx index 6d21ba5..36d5f0e 100644 --- a/mod/ci-common.hxx +++ b/mod/ci-common.hxx @@ -236,11 +236,12 @@ namespace brep build_state)> = nullptr) const; // Find the tenant given the tenant service type and id and return the - // associated data or nullopt if there is no such tenant. + // associated data plus the indication of whether the tenant is archived, + // or nullopt if there is no such tenant. // // Note: should be called out of the database transaction. // - optional + optional> find (odb::core::database&, const string& type, const string& id) const; -- cgit v1.1