fix: add WAL mode for session SQLite to prevent 'database is locked', persist active account tab in localStorage
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user