Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-zahedi committed May 15, 2024
1 parent eb8628d commit 379141b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions django_telethon/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ class SentFileAdmin(admin.ModelAdmin):
]
raw_id_fields = ['client_session']
list_filter = ['client_session__name']


8 changes: 5 additions & 3 deletions django_telethon/rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
from django_telethon.default_settings import (
QUEUE_CALLBACK_FN,
QUEUE_CHANNEL_NAME,
RABBITMQ_URL, RABBITMQ_ACTIVE,
RABBITMQ_ACTIVE,
RABBITMQ_URL,
)


__all__ = [
"send_to_telegra_thread",
]


async def process_message(message: aio_pika.IncomingMessage):
try:
async with message.process():
Expand All @@ -39,10 +42,9 @@ def send_to_telegra_thread(**payload):
connection = pika.BlockingConnection(parameters)
channel = connection.channel()

# Ensure the queue exists. You might want to move this outside the function if you know the queue already exists.
channel.queue_declare(queue=QUEUE_CHANNEL_NAME, durable=True)
byte_payload = str(payload).encode('utf-8')
# Send the message

channel.basic_publish(
exchange='',
routing_key=QUEUE_CHANNEL_NAME,
Expand Down

0 comments on commit 379141b

Please sign in to comment.