From fdafa80bac7e4993834b0a86e2e286c05db52401 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 20 Sep 2021 21:46:09 +0200 Subject: [PATCH] fsfs --- docker-compose.yml | 2 -- env | 2 -- files/__main__.py | 11 ++--------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a40d5e901..7546e040d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,6 @@ services: volumes: - "./:/service" environment: - - PYTHONPATH="/service" - - REDIS_URL=redis://redis - DATABASE_URL=postgresql://postgres@postgres:5432/postgres - MASTER_KEY=${MASTER_KEY:-KTVciAUQFpFh2WdJ/oiHJlxl6FvzRZp8kYzAAv3l2OA=} - DOMAIN=localhost diff --git a/env b/env index 32955fe56..d2e6205ff 100644 --- a/env +++ b/env @@ -1,5 +1,3 @@ -export PYTHONPATH="/service" -export REDIS_URL="redis://redis" export DATABASE_URL="postgresql://postgres@postgres:5432/postgres" export MASTER_KEY="-KTVciAUQFpFh2WdJ/oiHJlxl6FvzRZp8kYzAAv3l2OA=" export DOMAIN="localhost" diff --git a/files/__main__.py b/files/__main__.py index ba60b4f3f..b4cd5a8bc 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -11,7 +11,6 @@ from flaskext.markdown import Markdown from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy import * -from sqlalchemy.pool import QueuePool import gevent from werkzeug.middleware.proxy_fix import ProxyFix import redis @@ -76,16 +75,10 @@ limiter = Limiter( strategy="fixed-window" ) -_engine=create_engine( - app.config['DATABASE_URL'], - poolclass=QueuePool, - pool_size=97, - pool_use_lifo=True -) - - Base = declarative_base() +engine = create_engine(app.config['DATABASE_URL']) + db_session = scoped_session(sessionmaker(engine))