mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
fix: accurate wipe count on partial failure, remove stray blank line
This commit is contained in:
parent
0ee8cb5f02
commit
0020e5929d
2 changed files with 4 additions and 3 deletions
|
|
@ -15,14 +15,16 @@ from litellm._logging import verbose_proxy_logger
|
|||
def wipe_directory(directory: str) -> None:
|
||||
"""Delete all .db files in the directory. Called once before workers fork."""
|
||||
files = glob.glob(os.path.join(directory, "*.db"))
|
||||
deleted = 0
|
||||
for filepath in files:
|
||||
try:
|
||||
os.remove(filepath)
|
||||
deleted += 1
|
||||
except OSError as e:
|
||||
verbose_proxy_logger.warning(
|
||||
f"Failed to delete stale prometheus file {filepath}: {e}"
|
||||
)
|
||||
if files:
|
||||
if deleted:
|
||||
verbose_proxy_logger.info(
|
||||
f"Prometheus cleanup: wiped {len(files)} stale .db files from {directory}"
|
||||
f"Prometheus cleanup: wiped {deleted} stale .db files from {directory}"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2045,7 +2045,6 @@ def _schedule_background_health_check_db_save(
|
|||
)
|
||||
|
||||
|
||||
|
||||
async def _run_background_health_check():
|
||||
"""
|
||||
Periodically run health checks in the background on the endpoints.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue