fix: restore AsyncSession import and fix dead regex patterns in NOT_FOUND_PATTERNS
- Added missing 'from sqlalchemy.ext.asyncio import AsyncSession' import in downloads.py This fixes the NameError at module load time that was breaking all download tasks - Replaced regex patterns with plain-string equivalents in NOT_FOUND_PATTERNS: * 'account.*deleted' → 'account deleted' (. and * are literal in substring search) * 'profile.*not.*exist' → 'profile does not exist' (same issue) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -169,8 +169,8 @@ class GalleryDLService:
|
||||
"artist not found",
|
||||
"content no longer available",
|
||||
"has been deleted",
|
||||
"account.*deleted",
|
||||
"profile.*not.*exist",
|
||||
"account deleted",
|
||||
"profile does not exist",
|
||||
]
|
||||
GENERIC_NOT_FOUND_PATTERNS = ["does not exist", "no longer available"]
|
||||
NETWORK_ERROR_PATTERNS = [
|
||||
|
||||
@@ -6,6 +6,7 @@ from datetime import datetime, timedelta
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import select, and_, or_, update
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import selectinload
|
||||
|
||||
from app.tasks.db import get_async_session, cleanup_engine as _cleanup_engine
|
||||
|
||||
Reference in New Issue
Block a user