From afb429ec7726fcffeb9787ed37a0d20797c21ccd Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sat, 3 Nov 2018 20:58:01 -0300 Subject: [PATCH] gateway: change from 1200 guilds per shard to 1000 to more closely reproduce discord. --- litecord/blueprints/gateway.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litecord/blueprints/gateway.py b/litecord/blueprints/gateway.py index 9f1c4df..76567aa 100644 --- a/litecord/blueprints/gateway.py +++ b/litecord/blueprints/gateway.py @@ -6,12 +6,14 @@ bp = Blueprint('gateway', __name__) def get_gw(): + """Get the gateway's web""" proto = 'wss://' if app.config['IS_SSL'] else 'ws://' return f'{proto}{app.config["WEBSOCKET_URL"]}/ws' @bp.route('/gateway') def api_gateway(): + """Get the raw URL.""" return jsonify({ 'url': get_gw() }) @@ -27,8 +29,9 @@ async def api_gateway_bot(): WHERE user_id = $1 """, user_id) - shards = max(int(guild_count / 1200), 1) + shards = max(int(guild_count / 1000), 1) + # TODO: session_start_limit (depends on ratelimits) return jsonify({ 'url': get_gw(), 'shards': shards,