gateway: change from 1200 guilds per shard to 1000

to more closely reproduce discord.
This commit is contained in:
Luna Mendes 2018-11-03 20:58:01 -03:00
parent 0f7ffaf717
commit afb429ec77
1 changed files with 4 additions and 1 deletions

View File

@ -6,12 +6,14 @@ bp = Blueprint('gateway', __name__)
def get_gw(): def get_gw():
"""Get the gateway's web"""
proto = 'wss://' if app.config['IS_SSL'] else 'ws://' proto = 'wss://' if app.config['IS_SSL'] else 'ws://'
return f'{proto}{app.config["WEBSOCKET_URL"]}/ws' return f'{proto}{app.config["WEBSOCKET_URL"]}/ws'
@bp.route('/gateway') @bp.route('/gateway')
def api_gateway(): def api_gateway():
"""Get the raw URL."""
return jsonify({ return jsonify({
'url': get_gw() 'url': get_gw()
}) })
@ -27,8 +29,9 @@ async def api_gateway_bot():
WHERE user_id = $1 WHERE user_id = $1
""", user_id) """, 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({ return jsonify({
'url': get_gw(), 'url': get_gw(),
'shards': shards, 'shards': shards,