fix: add WAL mode for session SQLite to prevent 'database is locked', persist active account tab in localStorage

This commit is contained in:
2026-06-27 15:45:05 +02:00
parent 93f2b94dd2
commit 1bd385e054
3 changed files with 20 additions and 2 deletions
+2
View File
@@ -37,6 +37,7 @@ from health import health_payload
from scraper_jobs import ScraperJobService
from telethon import TelegramClient
from telethon.errors import SessionPasswordNeededError
from telegram_scraper_with_forwarding import _ensure_session_wal
BASE_DIR = Path(__file__).resolve().parent
@@ -462,6 +463,7 @@ class TelegramAuthManager:
if not api_id or not api_hash:
raise RuntimeError("Save api_id and api_hash first for this account.")
if account_id not in self.clients or self.clients[account_id] is None:
_ensure_session_wal(account_session_path(SESSION_DIR, account_id))
self.clients[account_id] = TelegramClient(
account_session_path(SESSION_DIR, account_id),
api_id,