Add admin panel
This commit is contained in:
@@ -19,7 +19,7 @@ FRONTEND_URL = os.getenv("FRONTEND_URL", "http://frontend:80")
|
||||
BOT_URL = os.getenv("BOT_URL", "http://bot:8080")
|
||||
EXTERNAL_URL = os.getenv("EXTERNAL_URL", "") # Public URL for external checks
|
||||
PUBLIC_URL = os.getenv("PUBLIC_URL", "") # Public HTTPS URL for SSL checks
|
||||
CHECK_INTERVAL = int(os.getenv("CHECK_INTERVAL", "30"))
|
||||
CHECK_INTERVAL = int(os.getenv("CHECK_INTERVAL", "600")) # 10 minutes
|
||||
|
||||
# Initialize monitor
|
||||
monitor = ServiceMonitor()
|
||||
@@ -46,11 +46,11 @@ async def periodic_health_check():
|
||||
|
||||
|
||||
async def periodic_cleanup():
|
||||
"""Background task to cleanup old metrics (daily)."""
|
||||
"""Background task to cleanup old metrics (hourly)."""
|
||||
while True:
|
||||
await asyncio.sleep(86400) # 24 hours
|
||||
await asyncio.sleep(3600) # 1 hour
|
||||
try:
|
||||
deleted = cleanup_old_metrics(days=7)
|
||||
deleted = cleanup_old_metrics(days=1) # Keep only last 24 hours
|
||||
print(f"Cleaned up {deleted} old metrics")
|
||||
except Exception as e:
|
||||
print(f"Cleanup error: {e}")
|
||||
|
||||
Reference in New Issue
Block a user