From 56e8ebbb2f9ce02149f248aecebe20fcfd1d8e07 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 2 Dec 2024 14:01:53 +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