Initial commit: LogHive centralized log management system

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
v6ole
2026-05-09 14:55:14 +08:00
commit abfd07331e
54 changed files with 3816 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
"""Celery application for async background tasks."""
from celery import Celery
from app.config import settings
celery_app = Celery(
"loghive",
broker=settings.CELERY_BROKER_URL,
backend=settings.CELERY_RESULT_BACKEND,
include=["celery_worker.tasks"],
)
celery_app.conf.update(
task_serializer="json",
accept_content=["json"],
result_serializer="json",
timezone="UTC",
enable_utc=True,
task_track_started=True,
task_acks_late=True,
worker_prefetch_multiplier=1,
beat_schedule={
"evaluate-alert-rules": {
"task": "celery_worker.tasks.evaluate_alerts",
"schedule": settings.ALERT_CHECK_INTERVAL_SECONDS,
},
"cleanup-old-log-indices": {
"task": "celery_worker.tasks.cleanup_old_indices",
"schedule": 3600, # once per hour
},
},
)