Skip to content

Commit

Permalink
2.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
SharpBit committed Sep 14, 2019
1 parent 08d78c7 commit 02d60d7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.

## [2.3.14] - 9/14/19
### Changed
- Default timeout from 10 to 30
### Fixed
- Cache is smaller due to smaller 3 r/s ratelimit (from 5)
- Fixed a bug where `UnexpectedError` did not work due to a typo.

## [2.3.13] - 8/29/19
### Added
- New brawler 8-Bit
Expand Down
2 changes: 1 addition & 1 deletion brawlstats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
############


__version__ = 'v2.3.13'
__version__ = 'v2.3.14'
__title__ = 'brawlstats'
__license__ = 'MIT'
__author__ = 'SharpBit'
Expand Down
2 changes: 1 addition & 1 deletion brawlstats/constants.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions brawlstats/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Client:
The API Key that you can get from https://brawlapi.cf/dashboard
session: Optional[Session] = None
Use a current session or a make new one. Can be ``aiohttp.ClientSession()`` or ``requests.Session()``
timeout: Optional[int] = 10
timeout: Optional[int] = 30
A timeout in seconds for requests to the API.
is_async: Optional[bool] = False
Setting this to ``True`` makes the client async.
Expand All @@ -49,7 +49,7 @@ class Client:

REQUEST_LOG = '{method} {url} recieved {text} has returned {status}'

def __init__(self, token, session=None, timeout=10, is_async=False, **options):
def __init__(self, token, session=None, timeout=30, is_async=False, **options):
self.is_async = is_async
self.loop = options.get('loop', asyncio.get_event_loop())
self.connector = options.get('connector')
Expand All @@ -62,7 +62,7 @@ def __init__(self, token, session=None, timeout=10, is_async=False, **options):
self.api = API(options.get('base_url'))

self.debug = options.get('debug', False)
self.cache = TTLCache(900, 180) # 5 requests/sec
self.cache = TTLCache(540, 180) # 3 requests/sec
self.ratelimit = [3, 3, 0] # per second, remaining, time until reset

self.headers = {
Expand Down
2 changes: 1 addition & 1 deletion brawlstats/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, url, code, data):
self.code = code
self.error = 'An unexpected error has occured.\nURL: ' + url
self.text = data
super().__init__(self.code, self.error, text=self.data)
super().__init__(self.code, self.error, text=self.text)


class ServerError(RequestError):
Expand Down

0 comments on commit 02d60d7

Please sign in to comment.