Fix: Use structlog consistently in sync_series_from_data_files
This commit is contained in:
parent
a67a16d6bf
commit
778d16b21a
@ -130,7 +130,7 @@ async def lifespan(_application: FastAPI):
|
||||
|
||||
# Sync series from data files to database
|
||||
sync_count = await sync_series_from_data_files(
|
||||
settings.anime_directory, logger
|
||||
settings.anime_directory
|
||||
)
|
||||
logger.info(
|
||||
"Data file sync complete. Added %d series.", sync_count
|
||||
|
||||
@ -861,7 +861,7 @@ def get_anime_service(series_app: SeriesApp) -> AnimeService:
|
||||
|
||||
async def sync_series_from_data_files(
|
||||
anime_directory: str,
|
||||
log_instance=None
|
||||
log_instance=None # pylint: disable=unused-argument
|
||||
) -> int:
|
||||
"""
|
||||
Sync series from data files to the database.
|
||||
@ -875,13 +875,14 @@ async def sync_series_from_data_files(
|
||||
|
||||
Args:
|
||||
anime_directory: Path to the anime directory with data files
|
||||
log_instance: Optional logger instance for logging operations.
|
||||
If not provided, uses structlog.
|
||||
log_instance: Optional logger instance (unused, kept for API
|
||||
compatibility). This function always uses structlog internally.
|
||||
|
||||
Returns:
|
||||
Number of new series added to the database
|
||||
"""
|
||||
log = log_instance or structlog.get_logger(__name__)
|
||||
# Always use structlog for structured logging with keyword arguments
|
||||
log = structlog.get_logger(__name__)
|
||||
|
||||
try:
|
||||
from src.server.database.connection import get_db_session
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user