Skip to content

Commit

Permalink
Changes PRODUCTION to DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Jun 3, 2023
1 parent 880c014 commit 1bfd9a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion admin/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from os import environ

PRODUCTION = bool(environ.get('PRODUCTION', False))
DEBUG = bool(environ.get('DEBUG', True))
DB_URL = environ.get('DB_URL', 'sqlite:///alfred.sqlite')
7 changes: 2 additions & 5 deletions admin/db.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from sqlalchemy import create_engine

from admin.config import DB_URL, PRODUCTION
from admin.config import DB_URL, DEBUG

engine = create_engine(
DB_URL, connect_args={'check_same_thread': PRODUCTION}, echo=not PRODUCTION
)
engine = create_engine(DB_URL, connect_args={'check_same_thread': False}, echo=DEBUG)


# TODO: implement async engine
def create_async_engine():
from sqlmodel.ext.asyncio.session import AsyncEngine

return AsyncEngine(engine)
return AsyncEngine(engine)

0 comments on commit 1bfd9a9

Please sign in to comment.