Skip to content

Commit

Permalink
Merge pull request #94 from TogetherCrew/feat/92-amqp-tracing-enable
Browse files Browse the repository at this point in the history
feat: enabling tracing for amqp server!
  • Loading branch information
amindadgar authored Nov 12, 2024
2 parents 55726aa + bda2859 commit 80afc66
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions routers/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from tc_messageBroker.rabbit_mq.queue import Queue
from utils.credentials import load_rabbitmq_credentials
from utils.persist_payload import PersistPayload
from utils.traceloop import init_tracing
from worker.tasks import query_data_sources
from worker.utils.fire_event import job_send

Expand All @@ -29,7 +30,7 @@ async def ask(payload: Payload, logger: Logger):
try:
question = payload.content.question.message
community_id = payload.content.communityId

init_tracing()
logger.info(f"COMMUNITY_ID: {community_id} Received job")
response = query_data_sources(community_id=community_id, query=question)
logger.info(f"COMMUNITY_ID: {community_id} Job finished")
Expand All @@ -45,11 +46,6 @@ async def ask(payload: Payload, logger: Logger):
persister = PersistPayload()
persister.persist_amqp(response_payload)

# result = Payload(
# event=payload.content.route.destination.event,
# date=str(datetime.now()),
# content=response_payload.model_dump(),
# )
job_send(
event=payload.content.route.destination.event,
queue_name=payload.content.route.destination.queue,
Expand Down

0 comments on commit 80afc66

Please sign in to comment.