Skip to content

Commit cf28429

Browse files
committed
fix: Move persistence and sqlite to "data" folder
1 parent 67c2041 commit cf28429

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,4 @@ cython_debug/
174174
.pypirc
175175

176176
# Custom
177-
bot_data.sqlite
178-
bot_data.pkl
177+
data/

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ services:
44
env_file:
55
- .env
66
restart: always
7+
volumes:
8+
- ./data:/app/data

src/inline_post_bot/database_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class DatabaseManager:
8-
def __init__(self, db_path="bot_data.sqlite"):
8+
def __init__(self, db_path="data/bot_data.sqlite"):
99
"""Initialize database connection and create tables if not exist"""
1010
self.db_path = db_path
1111
self._create_tables()

src/inline_post_bot/inline_telegram_bot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ async def start(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
175175
)
176176
return ConversationHandler.END
177177

178-
def build_application(self, persist_path="bot_data.pkl"):
178+
def build_application(self, persist_path="data/bot_data.pkl"):
179179
my_persistence = PicklePersistence(filepath=persist_path)
180180
application = (
181181
Application.builder()

0 commit comments

Comments
 (0)