diff --git a/config.py b/config.py index 0cc8ce3..1838908 100644 --- a/config.py +++ b/config.py @@ -17,3 +17,5 @@ sqlite_db_path = os.getenv('SQLITE_DB_PATH', 'squads_stat.sqlite3') log_level = os.getenv('LOG_LEVEL', 'DEBUG').upper() time_between_requests = os.getenv("TIME_BETWEEN_REQUESTS") + +sqlite2postgres_sqlite_location = os.getenv('SQLITE2POSTGRES_SQLITE_LOCATION') diff --git a/sqlite2postgres.py b/sqlite2postgres.py index b5df562..0f179f6 100644 --- a/sqlite2postgres.py +++ b/sqlite2postgres.py @@ -15,7 +15,7 @@ values (%(action_id)s, %(leaderboard_type)s, %(platform)s, %(squadron_id)s, %(score)s, %(percentile)s, %(rank)s, %(name)s, %(tag)s, %(timestamp)s);""" -sqlite_conn: sqlite3.Connection = sqlite3.connect('squads_stat.sqlite3', check_same_thread=False) +sqlite_conn: sqlite3.Connection = sqlite3.connect(config.sqlite2postgres_sqlite_location, check_same_thread=False) sqlite_conn.row_factory = lambda c, r: dict(zip([col[0] for col in c.description], r)) pg_conn: psycopg2.extensions.connection = psycopg2.connect(