Skip to content

Commit 02d60d7

Browse files
committed
2.3.14
1 parent 08d78c7 commit 02d60d7

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [2.3.14] - 9/14/19
5+
### Changed
6+
- Default timeout from 10 to 30
7+
### Fixed
8+
- Cache is smaller due to smaller 3 r/s ratelimit (from 5)
9+
- Fixed a bug where `UnexpectedError` did not work due to a typo.
10+
411
## [2.3.13] - 8/29/19
512
### Added
613
- New brawler 8-Bit

brawlstats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
############
99

1010

11-
__version__ = 'v2.3.13'
11+
__version__ = 'v2.3.14'
1212
__title__ = 'brawlstats'
1313
__license__ = 'MIT'
1414
__author__ = 'SharpBit'

brawlstats/constants.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

brawlstats/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Client:
2727
The API Key that you can get from https://brawlapi.cf/dashboard
2828
session: Optional[Session] = None
2929
Use a current session or a make new one. Can be ``aiohttp.ClientSession()`` or ``requests.Session()``
30-
timeout: Optional[int] = 10
30+
timeout: Optional[int] = 30
3131
A timeout in seconds for requests to the API.
3232
is_async: Optional[bool] = False
3333
Setting this to ``True`` makes the client async.
@@ -49,7 +49,7 @@ class Client:
4949

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

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

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

6868
self.headers = {

brawlstats/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, url, code, data):
3939
self.code = code
4040
self.error = 'An unexpected error has occured.\nURL: ' + url
4141
self.text = data
42-
super().__init__(self.code, self.error, text=self.data)
42+
super().__init__(self.code, self.error, text=self.text)
4343

4444

4545
class ServerError(RequestError):

0 commit comments

Comments
 (0)