Skip to content

Commit

Permalink
Small fixes and v5.3.0 prep (#219)
Browse files Browse the repository at this point in the history
* Add request timeout to cache bootstrap from URL.

* Only send Slack messages if not a fork (so CI doesn't fail for contributers).

* Update README.md.
  • Loading branch information
ivanklee86 authored Sep 1, 2022
1 parent c47f071 commit 1861dd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.github_slack_token }}
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook }}
if: always()
if: ${{ github.event.pull_request.head.repo.full_name != 'Unleash/unleash-client-python' }} && (success() || failure())

tox:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v5.3.0
* (Minor) Add retries to GET /features. Thanks @janboll!
* (Minor) Add global segments. Thanks @sighphyre!
* (Minor) Documentation updates and tweaks. Thanks @inirudebwoy, @sighphyre, @thomasheartman !

## v5.2.0
* (Minor) Add support for bootstrapping UnleashClient with an initial configuration.
* (Minor) Add flag to disable toggle polling from server. Thanks @povilasb!
Expand Down
4 changes: 2 additions & 2 deletions UnleashClient/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import requests
from fcache.cache import FileCache as _FileCache
from UnleashClient.constants import FEATURES_URL
from UnleashClient.constants import FEATURES_URL, REQUEST_TIMEOUT


class BaseCache(abc.ABC):
Expand Down Expand Up @@ -104,7 +104,7 @@ def bootstrap_from_url(self, initial_config_url: str, headers: Optional[dict] =
:param initial_configuration_url: Url that returns document containing initial configuration. Must return JSON.
:param headers: Headers to use when GETing the initial configuration URL.
"""
response = requests.get(initial_config_url, headers=headers)
response = requests.get(initial_config_url, headers=headers, timeout=REQUEST_TIMEOUT)
self.set(FEATURES_URL, response.json())
self.bootstrapped = True

Expand Down

0 comments on commit 1861dd9

Please sign in to comment.