Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Add typing hints to get rabbitmq connections
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed Sep 11, 2024
1 parent 8d8b04e commit 172b820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/flask/test_rock/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_redis_database() -> redis.Redis | None:
return g.redis_db


def get_rabbitmq_connection():
def get_rabbitmq_connection() -> pika.BlockingConnection | None:
"""Get rabbitmq connection."""
if "rabbitmq" not in g:
if "RABBITMQ_HOSTNAME" in os.environ:
Expand All @@ -91,7 +91,7 @@ def get_rabbitmq_connection():
return g.rabbitmq


def get_rabbitmq_connection_from_uri():
def get_rabbitmq_connection_from_uri() -> pika.BlockingConnection | None:
"""Get rabbitmq connection from uri."""
if "rabbitmq_from_uri" not in g:
if "RABBITMQ_CONNECT_STRING" in os.environ:
Expand Down

0 comments on commit 172b820

Please sign in to comment.