diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-05-22 19:12:55 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-05-23 15:40:29 +0300 |
commit | 3d7f248ee7aa7e5b470cb9bc2fcf76852e798db5 (patch) | |
tree | 81104c01134be4eda13d5f0b1fc8320a9f6a2544 /mod/ci-common.cxx | |
parent | bad54b28bcc59fe5d19ecaf486f52e6359009e68 (diff) |
Make poll interval for unloaded tenant configurable and rename loaded_timestamp tenant member to unloaded_timestamp
Diffstat (limited to 'mod/ci-common.cxx')
-rw-r--r-- | mod/ci-common.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
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"; |