BrickGrass / StarlightGlimmer

A pixel website utility bot
Other
3 stars 5 forks source link

Add delay between pxls.space/ws requests #18

Closed VanillaSixtySix closed 2 years ago

VanillaSixtySix commented 2 years ago

I noticed this script making ~16 requests per second to the pxls.space/ws endpoint when it responds with 502, flooding the access log.

BrickGrass commented 2 years ago

https://github.com/BrickGrass/StarlightGlimmer/blob/c08607148d919ac33c711b94e9674dc86b1e06ac/utils/websocket.py#L381 the code starting right here should exponentially rate limit on failures, is that not working whatsoever or is it not increasing it's timeouts fast enough?

VanillaSixtySix commented 2 years ago

https://github.com/BrickGrass/StarlightGlimmer/blob/c08607148d919ac33c711b94e9674dc86b1e06ac/utils/websocket.py#L381

the code starting right here should exponentially rate limit on failures, is that not working whatsoever or is it not increasing it's timeouts fast enough?

Someone might be running a fork of the bot without any sort of rate limiting, so if this was already a feature, my bad!

BrickGrass commented 2 years ago

Well my code could still be faulty! If you're in contact with the person running this instance double check what code they're running at that section, and if it is mine I can totally take a look :)