Last active
February 27, 2022 20:52
-
-
Save anandtripathi5/0a1df3b5008aa75e39dd2a25cfd443ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_socketio import Namespace, disconnect | |
from flask import current_app as app | |
from extensions import db | |
class BaseSocket(Namespace): | |
def on_connect(self): | |
pass | |
def on_disconnect(self): | |
disconnect() | |
app.logger.info("socket disconnected") | |
db.session.remove() # this is important | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment