Convert Eager Logging to Lazy Logging

This commit is contained in:
pixeebot[bot]
2025-04-19 03:06:42 +00:00
committed by GitHub
parent 2e7ed15038
commit e632f3a7f0

View File

@@ -341,14 +341,11 @@ class QueueCleaner:
metrics_manager.update_cleanup_time() metrics_manager.update_cleanup_time()
logger.info( logger.info(
f"Cleanup completed ({mode.value}):\n" + "%s%s%s", f"Cleanup completed ({mode.value}):\n", "\n".join(
"\n".join(
f"- {phase.value}: {count} items" f"- {phase.value}: {count} items"
for phase, count in items_cleaned.items() for phase, count in items_cleaned.items()
if count > 0 if count > 0
) + ), f"\nTotal duration: {duration:.2f}s")
f"\nTotal duration: {duration:.2f}s"
)
except Exception as e: except Exception as e:
logger.error(f"Error during cleanup: {str(e)}") logger.error(f"Error during cleanup: {str(e)}")