diff --git a/flaredestroyy.py b/flaredestroyy.py new file mode 100644 index 0000000..afedadf --- /dev/null +++ b/flaredestroyy.py @@ -0,0 +1,18 @@ +import json + +import requests + +from pynyaata.config import CLOUDPROXY_ENDPOINT + +json_session = requests.post(CLOUDPROXY_ENDPOINT, data=json.dumps({ + 'cmd': 'sessions.list' +})) +response = json.loads(json_session.text) +sessions = response['sessions'] + +for session in sessions: + requests.post(CLOUDPROXY_ENDPOINT, data=json.dumps({ + 'cmd': 'sessions.destroy', + 'session': session + })) + print('Destroyed %s' % session) diff --git a/get404.py b/get404.py index 2085f82..0a8ab80 100644 --- a/get404.py +++ b/get404.py @@ -1,8 +1,6 @@ -from pynyaata.config import app from pynyaata.connectors.core import curl_content from pynyaata.models import AnimeLink -app.config['SQLALCHEMY_ECHO'] = False links = AnimeLink.query.all() for link in links: diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index 7bb03d2..3dfbdd4 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -192,4 +192,5 @@ def admin_edit(link_id=None): def run(): + app.config['SQLALCHEMY_ECHO'] = IS_DEBUG app.run('0.0.0.0', APP_PORT, IS_DEBUG) diff --git a/pynyaata/config.py b/pynyaata/config.py index e20ff94..34dfe62 100644 --- a/pynyaata/config.py +++ b/pynyaata/config.py @@ -37,7 +37,6 @@ if db_host: db_user, db_password, db_host, db_name ) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True - app.config['SQLALCHEMY_ECHO'] = IS_DEBUG app.config['SQLALCHEMY_ENGINE_OPTIONS'] = { 'pool_recycle': 200 }