aboutsummaryrefslogtreecommitdiff
path: root/mod/ci-common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-10-17 09:05:04 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-12-10 16:34:15 +0200
commit1105538dd56dbb1b261d8b0ce8652f1dd719eaee (patch)
tree677c299c7c7aeec1e89f672a9079373bb7abd6b3 /mod/ci-common.cxx
parent24415b406a6457638fc4e5435bab9fed987d01ba (diff)
Sketch CI common API changes
Diffstat (limited to 'mod/ci-common.cxx')
-rw-r--r--mod/ci-common.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx
index c0ef89f..b3fc432 100644
--- a/mod/ci-common.cxx
+++ b/mod/ci-common.cxx
@@ -534,14 +534,15 @@ namespace brep
s.next ("", ""); // End of manifest.
}
- optional<string> ci_start::
+ pair<optional<string>, ci_start::duplicate_tenant_result> ci_start::
create (const basic_mark& error,
const basic_mark&,
const basic_mark* trace,
odb::core::database& db,
tenant_service&& service,
duration notify_interval,
- duration notify_delay) const
+ duration notify_delay,
+ duplicate_tenant_mode) const
{
using namespace odb::core;
@@ -556,7 +557,7 @@ namespace brep
catch (const system_error& e)
{
error << "unable to generate request id: " << e;
- return nullopt;
+ return {nullopt, duplicate_tenant_result::ignored}; // @@ TODO HACKED AROUND
}
// Use the generated request id if the tenant service id is not specified.
@@ -604,7 +605,7 @@ namespace brep
*trace << "unloaded CI request " << t.id << " for service "
<< t.service->id << ' ' << t.service->type << " is created";
- return move (t.id);
+ return {move (t.id), duplicate_tenant_result::created}; // @@ TODO HACKED AROUND
}
optional<ci_start::start_result> ci_start::
@@ -707,6 +708,8 @@ namespace brep
if (t == nullptr)
return nullopt;
+ // @@ Why not remove it if unloaded (and below)?
+
optional<tenant_service> r (move (t->service));
t->service = nullopt;
t->archived = true;