Skip to content

Reduce RateLimiter requests timeout #50

@ctmbl

Description

@ctmbl

default timeout for rate mlimiter requets is 20 :

DEFAULT_REQUEST_TIMEOUT = 20

self._request_timeout = request_timeout or DEFAULT_REQUEST_TIMEOUT

and no custom timeout is used when instancing the rate limiter:
api_manager = RootMeAPIManager(rate_limiter)

this timeout is to big and triggers dirscord.gateway timeout:

2023-12-05 03:43:59 WARNING  discord.gateway Shard ID None heartbeat blocked for more than 10 seconds.
Loop thread traceback (most recent call last):
  File "/opt/root-pythia/src/main.py", line 75, in <module>
    main()
[big tracback]

2023-12-05 03:44:09 WARNING  discord.gateway Shard ID None heartbeat blocked for more than 20 seconds.
Loop thread traceback (most recent call last):
  File "/opt/root-pythia/src/main.py", line 75, in <module>
    main()
[big tracback]

2023-12-05 03:44:10 ERROR    api.rate_limiter Request GET: https://api.www.root-me.org//auteurs/<CENSORED> + {'api_key': '<CENSORED>'} Timeout
2023-12-05 03:44:10 INFO     discord.gateway Shard ID None has successfully RESUMED session <CENSORED>.

Which is useless

Reducing the timeout below 10 will save numeroux useless false positive errors and logs

Metadata

Metadata

Assignees

Labels

invalidThis doesn't seem right

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions