Skip to content

Commit d7d2478

Browse files
authored
DX-1612: Read QSTASH_URL env variable (#35)
* feat: read QSTASH_URL env variable * fix: get QSTASH_URL with .get
1 parent b5e66b1 commit d7d2478

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

qstash/asyncio/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from os import environ
12
from typing import Literal, Optional, Union
23

34
from qstash.asyncio.chat import AsyncChatApi
@@ -27,7 +28,7 @@ def __init__(
2728
self.http = AsyncHttpClient(
2829
token,
2930
retry,
30-
base_url,
31+
base_url or environ.get("QSTASH_URL"),
3132
)
3233
self.message = AsyncMessageApi(self.http)
3334
"""Message api."""

qstash/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from os import environ
12
from typing import Optional, Union, Literal
23

34
from qstash.chat import ChatApi
@@ -28,7 +29,7 @@ def __init__(
2829
self.http = HttpClient(
2930
token,
3031
retry,
31-
base_url,
32+
base_url or environ.get("QSTASH_URL"),
3233
)
3334
self.message = MessageApi(self.http)
3435
"""Message api."""

0 commit comments

Comments
 (0)