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:
2026-03-18 23:43:01 -04:00
parent 48d10ec21e
commit 8cd0ce4ecb
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -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 = [
+1
View File
@@ -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