From 3d7f248ee7aa7e5b470cb9bc2fcf76852e798db5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 May 2024 19:12:55 +0300 Subject: Make poll interval for unloaded tenant configurable and rename loaded_timestamp tenant member to unloaded_timestamp --- mod/ci-common.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'mod/ci-common.cxx') diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx index bd283f4..6ce47f2 100644 --- a/mod/ci-common.cxx +++ b/mod/ci-common.cxx @@ -539,7 +539,9 @@ namespace brep const basic_mark&, const basic_mark* trace, odb::core::database& db, - tenant_service&& service) const + tenant_service&& service, + duration notify_interval, + duration notify_delay) const { using namespace odb::core; @@ -562,13 +564,10 @@ namespace brep if (service.id.empty ()) service.id = request_id; - // Delay the first load attempt for 10 seconds (see mod-build-task.cxx for - // details). - // build_tenant t (move (request_id), move (service), - system_clock::now () - chrono::seconds (40 - 10)); - + system_clock::now () - notify_interval + notify_delay, + notify_interval); { assert (!transaction::has_current ()); @@ -644,7 +643,7 @@ namespace brep return nullopt; } - else if (!t->loaded_timestamp) + else if (!t->unloaded_timestamp) { error << "tenant " << t->id << " for service " << service.id << ' ' << service.type << " is already loaded"; @@ -652,7 +651,7 @@ namespace brep return nullopt; } - t->loaded_timestamp = nullopt; + t->unloaded_timestamp = nullopt; db.update (t); tr.commit (); @@ -712,7 +711,7 @@ namespace brep return; } - else if (!t->loaded_timestamp) + else if (!t->unloaded_timestamp) { error << "tenant " << t->id << " for service " << service.id << ' ' << service.type << " is already loaded"; -- cgit v1.1