Skip to content

Commit

Permalink
FIX: Remove octue.services prefix from subscription names
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Aug 26, 2024
1 parent 63c86fc commit b1e8e81
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions octue/cloud/pub_sub/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def serve(self, timeout=None, delete_topic_and_subscription_on_exit=False, allow
logger.info("Starting %r.", self)

subscription = Subscription(
name=".".join((OCTUE_SERVICES_PREFIX, self._pub_sub_id)),
name=self._pub_sub_id,
topic=self.services_topic,
filter=f'attributes.recipient = "{self.id}" AND attributes.sender_type = "{PARENT_SENDER_TYPE}"',
expiration_time=None,
Expand Down Expand Up @@ -344,10 +344,8 @@ def ask(

# If not using a service registry, check for that the service revision exists by checking for its subscription.
elif service_revision_tag:
pub_sub_id = convert_service_id_to_pub_sub_form(service_id)

service_revision_subscription = Subscription(
name=".".join((OCTUE_SERVICES_PREFIX, pub_sub_id)),
name=convert_service_id_to_pub_sub_form(service_id),
topic=self.services_topic,
)

Expand Down Expand Up @@ -379,7 +377,7 @@ def ask(
answer_subscription = None
else:
answer_subscription = Subscription(
name=".".join((OCTUE_SERVICES_PREFIX, self._pub_sub_id, ANSWERS_NAMESPACE, question_uuid)),
name=".".join((self._pub_sub_id, ANSWERS_NAMESPACE, question_uuid)),
topic=self.services_topic,
filter=(
f'attributes.recipient = "{self.id}" '
Expand Down

0 comments on commit b1e8e81

Please sign in to comment.