Skip to content

Commit

Permalink
Update cross-server condition for adding parent
Browse files Browse the repository at this point in the history
  • Loading branch information
1maple1 committed Apr 17, 2024
1 parent cef7612 commit 16df326
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions brewtils/rest/system_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,20 +511,20 @@ def _wait_for_request(self, request, raise_on_error, timeout):
raise RequestFailedError(request)

# Support cross-server parent/child requests by adding parent if request has different namespace from plugin that created it.
if (
request.parent is None
and request.namespace != brewtils.plugin.CONFIG.namespace
if request.parent is None and (
brewtils.plugin.CONFIG.bg_host.upper()
!= self._easy_client.client.bg_host.upper()
or brewtils.plugin.CONFIG.bg_port != self._easy_client.client.bg_url_prefix
or brewtils.plugin.CONFIG.bg_port != self._easy_client.client.bg_url_prefix
):
self._logger.info(
f"Adding parent {brewtils.plugin.CONFIG.name}:{brewtils.plugin.CONFIG.namespace} to child request {request.system}:{request.namespace}"
)
request.parent = getattr(
brewtils.plugin.request_context, "current_request", None
)
request.has_parent = True
ec = EasyClient(
bg_host=brewtils.plugin.CONFIG.bg_host,
bg_port=brewtils.plugin.CONFIG.bg_port,
bg_url_prefix=brewtils.plugin.CONFIG.bg_url_prefix,
)
ec.put_request(request)

Expand Down

0 comments on commit 16df326

Please sign in to comment.