Skip to content

Commit 242ccb0

Browse files
committed
Change params to use broker url
1 parent d3c7584 commit 242ccb0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ OTP_LIFETIME=10
3232
API_GATEWAY_PUBLIC_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
3333
API_KEY_EXPIRES_AT=2
3434

35-
RABBITMQ_HOST=localhost
35+
# amqp://username:password@host[:port]/
36+
RABBITMQ_URL=amqp://guest:guest@localhost:5672/

src/config/asgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from src.env import rabbitmq_config
1818

19-
broker = RabbitBroker(host=rabbitmq_config["host"])
19+
broker = RabbitBroker(rabbitmq_config["url"])
2020

2121

2222
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.config.settings")

src/env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class OTP(TypedDict):
5151

5252

5353
class RabbitMQ(TypedDict):
54-
host: str
54+
url: str
5555

5656

5757
env = Env()
@@ -109,7 +109,7 @@ class RabbitMQ(TypedDict):
109109

110110
otp: OTP = {"lifetime": get_env_int("OTP_LIFETIME")}
111111

112-
rabbitmq_config: RabbitMQ = {"host": get_env_str("RABBITMQ_HOST")}
112+
rabbitmq_config: RabbitMQ = {"url": get_env_str("RABBITMQ_URL")}
113113

114114

115115
__all__ = [

0 commit comments

Comments
 (0)