mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-14 10:01:21 +01:00
parent
b897dad023
commit
65ec0d28e2
@ -84,7 +84,7 @@ class Gateway(Namespace):
|
||||
status = update_user_status(guild_id, session["username"], key)
|
||||
if status["revoked"] or status["banned"]:
|
||||
emit("revoke")
|
||||
#time.sleep(1000)
|
||||
time.sleep(1000)
|
||||
disconnect()
|
||||
else:
|
||||
emit("ack")
|
||||
|
@ -55,12 +55,11 @@ class DiscordREST:
|
||||
for tries in range(5):
|
||||
curepoch = time.time()
|
||||
if self._get_bucket("global_limited") == "True":
|
||||
#time.sleep(int(float(self._get_bucket("global_limit_expire"))) - curepoch)
|
||||
time.sleep(int(float(self._get_bucket("global_limit_expire"))) - curepoch)
|
||||
curepoch = time.time()
|
||||
|
||||
if self._bucket_contains(url) and float(int(self._get_bucket(url))) > curepoch:
|
||||
#time.sleep(int(self._get_bucket(url)) - curepoch)
|
||||
pass
|
||||
time.sleep(int(self._get_bucket(url)) - curepoch)
|
||||
|
||||
url_formatted = _DISCORD_API_BASE + url
|
||||
if data and "payload_json" in data:
|
||||
@ -92,7 +91,7 @@ class DiscordREST:
|
||||
self._set_bucket("global_limit_expire", time.time() + int(req.headers['Retry-After']))
|
||||
|
||||
if req.status_code == 502 and tries <= 5:
|
||||
#time.sleep(1 + tries * 2)
|
||||
time.sleep(1 + tries * 2)
|
||||
continue
|
||||
|
||||
if req.status_code == 403 or req.status_code == 404:
|
||||
|
@ -18,7 +18,7 @@ class RedisQueue:
|
||||
while (not data and data != "") and loop_count < 50:
|
||||
if loop_count % 25 == 0:
|
||||
redis_store.publish("discord-api-req", json.dumps(payload))
|
||||
#time.sleep(0.1)
|
||||
time.sleep(0.1)
|
||||
data = self._get(key, data_type)
|
||||
loop_count += 1
|
||||
redis_store.expire(key, 60 * 5)
|
||||
|
Loading…
Reference in New Issue
Block a user