testing on identify

This commit is contained in:
Jeremy Zhang
2019-01-01 19:32:28 +00:00
parent 510f801f79
commit 0bafccc044
3 changed files with 7 additions and 8 deletions

View File

@ -8,13 +8,11 @@ import json
from titanembeds.decorators import timeit
class Gateway(Namespace):
@timeit
def teardown_db_session(self):
time.sleep(0)
db.session.commit()
db.session.remove()
@timeit
def on_connect(self):
emit('hello')
@ -52,7 +50,6 @@ class Gateway(Namespace):
emit("identified")
self.teardown_db_session()
@timeit
def on_disconnect(self):
time.sleep(0)
if "user_keys" not in session:
@ -85,7 +82,6 @@ class Gateway(Namespace):
discord_api.delete_webhook(webhook["id"], webhook["token"])
self.teardown_db_session()
@timeit
def on_heartbeat(self, data):
time.sleep(0)
if "socket_guild_id" not in session:
@ -118,7 +114,6 @@ class Gateway(Namespace):
return
self.teardown_db_session()
@timeit
def on_channel_list(self, data):
time.sleep(0)
if "socket_guild_id" not in session:
@ -140,7 +135,6 @@ class Gateway(Namespace):
emit("channel_list", channels)
self.teardown_db_session()
@timeit
def on_current_user_info(self, data):
time.sleep(0)
if "socket_guild_id" not in session:
@ -159,7 +153,6 @@ class Gateway(Namespace):
emit("current_user_info", usr)
self.teardown_db_session()
@timeit
def get_user_color(self, guild_id, user_id):
color = None
member = redisqueue.get_guild_member(guild_id, user_id)
@ -188,7 +181,6 @@ class Gateway(Namespace):
color = "0" + color
return color
@timeit
def on_lookup_user_info(self, data):
time.sleep(0)
if "socket_guild_id" not in session: