diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-04-24 11:39:14 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-04-24 11:39:14 +0300 |
commit | 5f2539b772d068ddc541f3bbcfcb4a3430fa496e (patch) | |
tree | ff2db21780260cde8183b65a5801ce0454966c16 /mod/mod-build-task.cxx | |
parent | 9d539574d55ad5c65d15c040ec40764ffb1f601e (diff) |
Fix tenant service related logic in build task handler
Diffstat (limited to 'mod/mod-build-task.cxx')
-rw-r--r-- | mod/mod-build-task.cxx | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/mod/mod-build-task.cxx b/mod/mod-build-task.cxx index e0aad4b..c4968a7 100644 --- a/mod/mod-build-task.cxx +++ b/mod/mod-build-task.cxx @@ -2205,7 +2205,7 @@ handle (request& rq, response& rs) { assert (tss); // Wouldn't be here otherwise. - const tenant_service& ss (tss->first); + tenant_service& ss (tss->first); // If the task build has no initial state (is just created), then // temporarily move it into the list of the queued builds until the @@ -2228,7 +2228,11 @@ handle (request& rq, response& rs) nullopt /* initial_state */, qhs, log_writer_)) - update_tenant_service_state (conn, qbs.back ().tenant, f); + { + if (optional<string> data = + update_tenant_service_state (conn, qbs.back ().tenant, f)) + ss.data = move (data); + } } // Send the `queued` notification for the task build, unless it is @@ -2248,7 +2252,11 @@ handle (request& rq, response& rs) initial_state, qhs, log_writer_)) - update_tenant_service_state (conn, qbs.back ().tenant, f); + { + if (optional<string> data = + update_tenant_service_state (conn, qbs.back ().tenant, f)) + ss.data = move (data); + } } if (restore_build) @@ -2264,11 +2272,15 @@ handle (request& rq, response& rs) { assert (tss); // Wouldn't be here otherwise. - const tenant_service& ss (tss->first); + tenant_service& ss (tss->first); const build& b (*tss->second); if (auto f = tsb->build_building (ss, b, log_writer_)) - update_tenant_service_state (conn, b.tenant, f); + { + if (optional<string> data = + update_tenant_service_state (conn, b.tenant, f)) + ss.data = move (data); + } } // If the task manifest is prepared, then check that the number of the @@ -2377,11 +2389,15 @@ handle (request& rq, response& rs) { assert (tss); // Wouldn't be here otherwise. - const tenant_service& ss (tss->first); + tenant_service& ss (tss->first); const build& b (*tss->second); if (auto f = tsb->build_built (ss, b, log_writer_)) - update_tenant_service_state (conn, b.tenant, f); + { + if (optional<string> data = + update_tenant_service_state (conn, b.tenant, f)) + ss.data = move (data); + } } } |