We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5b9e13 commit 36762d5Copy full SHA for 36762d5
docker-compose.yml
@@ -0,0 +1,10 @@
1
+services:
2
+ tfinance_bot:
3
+ build: .
4
+ container_name: tfinance_bot
5
+ env_file:
6
+ - ./.env
7
+ restart: unless-stopped
8
+ volumes:
9
+ - ./etc_tfinance/logs:/tfinance/logs
10
+ - ./etc_tfinance/sqlite:/tfinance/sqlite
tfinance/database.py
@@ -1,4 +1,5 @@
import sqlite3
+from pathlib import Path
from models import User
from tfinance.config import DATABASE_NAME
@@ -23,6 +24,7 @@ class Database:
23
24
25
def __init__(self):
26
# Подключение к БД с отключенной проверкой потока.
27
+ Path("sqlite").mkdir(exist_ok=True)
28
self.con = sqlite3.connect(f"{DATABASE_NAME}.db", check_same_thread=False)
29
self.cur = self.con.cursor()
30
self.setup()
0 commit comments