From 831bfb98a24787c889936b2222672b449a880abd Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 20 Aug 2023 21:12:10 -0600 Subject: [PATCH] Using refresh logger to log file upserting. --- wrolpi/files/lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index 9b6605d8..460f7b87 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -327,7 +327,7 @@ def get_primary_file(files: Union[Tuple[pathlib.Path], List[pathlib.Path]]) -> U if mimetype.startswith('image/'): return file - logger.debug(f'Cannot find primary file for group: {files}') + refresh_logger.debug(f'Cannot find primary file for group: {files}') # Can't find a typical primary file. return files @@ -414,7 +414,7 @@ def _upsert_files(files: List[pathlib.Path], idempotency: datetime.datetime): if need_index: refresh_logger.info(f'Invalidated indexes of {len(need_index)} file groups near {str(chunk[0])}') else: - logger.debug(f'Upserted {len(chunk)} files near {str(chunk[0])}') + refresh_logger.debug(f'Upserted {len(chunk)} files near {str(chunk[0])}') if non_primary_files: # New files may have been added which change what primary paths exist. Delete any file_groups which @@ -457,7 +457,7 @@ async def refresh_discover_paths(paths: List[pathlib.Path], idempotency: datetim try: _upsert_files(files, idempotency) except Exception as e: - logger.error(f'Failed to upsert files', exc_info=e) + refresh_logger.error(f'Failed to upsert files', exc_info=e) files = list() # Sleep to catch cancel. await asyncio.sleep(0) @@ -466,7 +466,7 @@ async def refresh_discover_paths(paths: List[pathlib.Path], idempotency: datetim try: _upsert_files(files, idempotency) except Exception as e: - logger.error(f'Failed to upsert files', exc_info=e) + refresh_logger.error(f'Failed to upsert files', exc_info=e) with get_db_curs(commit=True) as curs: wheres = ''