-
Notifications
You must be signed in to change notification settings - Fork 3
Add Optional base_url Parameter to Clients #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
qstash/client.py
Outdated
| http = HttpClient( | ||
| token, | ||
| retry, | ||
| base_url=(base_url or "https://qstash.upstash.io"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for another default here
qstash/asyncio/client.py
Outdated
| http = AsyncHttpClient( | ||
| token, | ||
| retry, | ||
| base_url=(base_url or "https://qstash.upstash.io"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for another default here
qstash/asyncio/http.py
Outdated
| self, | ||
| token: str, | ||
| retry: Optional[Union[Literal[False], RetryConfig]], | ||
| base_url: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be optional with default value None
qstash/http.py
Outdated
| self, | ||
| token: str, | ||
| retry: Optional[Union[Literal[False], RetryConfig]], | ||
| base_url: str, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be optional with default value none
qstash/asyncio/http.py
Outdated
| timeout=DEFAULT_TIMEOUT, | ||
| ) | ||
|
|
||
| self._base_url = base_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can make this base_url.rstrip("/") if base_url else BASE_URL to get rid of tri-operand or in every call to request, and restore the rstrip behavior
This PR adds the optional
base_urlparameter to QStash clients. This can be used to change the url of the QStash client for development/testing purposes.