From 3871a466fa21ed7ecb6a7b1d1d5ef4d14b736a48 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 Dec 2024 11:45:35 +0200 Subject: Add tenant id to tenant service notifications and callbacks --- mod/ci-common.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mod/ci-common.cxx') diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx index cba421b..e720914 100644 --- a/mod/ci-common.cxx +++ b/mod/ci-common.cxx @@ -955,7 +955,8 @@ namespace brep rebuild (odb::core::database& db, size_t retry, const build_id& id, - function (const tenant_service&, + function (const string& tenant_id, + const tenant_service&, build_state)> uf) const { using namespace odb::core; @@ -1002,7 +1003,7 @@ namespace brep tenant_service& ts (*t->service); - if (optional data = uf (ts, s)) + if (optional data = uf (t->id, ts, s)) { ts.data = move (*data); db.update (t); @@ -1030,7 +1031,7 @@ namespace brep return s; } - optional> ci_start:: + optional ci_start:: find (odb::core::database& db, const string& type, const string& id) const @@ -1052,6 +1053,6 @@ namespace brep if (t == nullptr || !t->service) return nullopt; - return pair (move (*t->service), t->archived); + return tenant_data {move (t->id), move (*t->service), t->archived}; } } -- cgit v1.1