Add a flaresolverr cleaner
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2021-01-29 17:45:32 +01:00
parent 7bee5b7b09
commit 320207e3b0
4 changed files with 19 additions and 3 deletions

18
flaredestroyy.py Normal file
View File

@ -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)

View File

@ -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:

View File

@ -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)

View File

@ -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
}