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 series from data files to database
|
||||||
sync_count = await sync_series_from_data_files(
|
sync_count = await sync_series_from_data_files(
|
||||||
settings.anime_directory, logger
|
settings.anime_directory
|
||||||
)
|
)
|
||||||
logger.info(
|
logger.info(
|
||||||
"Data file sync complete. Added %d series.", sync_count
|
"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(
|
async def sync_series_from_data_files(
|
||||||
anime_directory: str,
|
anime_directory: str,
|
||||||
log_instance=None
|
log_instance=None # pylint: disable=unused-argument
|
||||||
) -> int:
|
) -> int:
|
||||||
"""
|
"""
|
||||||
Sync series from data files to the database.
|
Sync series from data files to the database.
|
||||||
@ -875,13 +875,14 @@ async def sync_series_from_data_files(
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
anime_directory: Path to the anime directory with data files
|
anime_directory: Path to the anime directory with data files
|
||||||
log_instance: Optional logger instance for logging operations.
|
log_instance: Optional logger instance (unused, kept for API
|
||||||
If not provided, uses structlog.
|
compatibility). This function always uses structlog internally.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Number of new series added to the database
|
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:
|
try:
|
||||||
from src.server.database.connection import get_db_session
|
from src.server.database.connection import get_db_session
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user