- error handling now uses a more comprehensive error communication system.
This commit is contained in:
@@ -28,18 +28,19 @@ def create_app(config_file=None):
|
||||
|
||||
configure_logging()
|
||||
|
||||
app.logger.info('Starting up eveai_chat_workers...')
|
||||
register_extensions(app)
|
||||
|
||||
register_cache_handlers(app)
|
||||
|
||||
from . import specialists, retrievers
|
||||
|
||||
celery = make_celery(app.name, app.config)
|
||||
init_celery(celery, app)
|
||||
|
||||
register_cache_handlers(app)
|
||||
from . import tasks
|
||||
|
||||
from eveai_chat_workers import tasks
|
||||
print(tasks.tasks_ping())
|
||||
app.logger.info("EveAI Worker Server Started Successfully")
|
||||
app.logger.info("-------------------------------------------------------------------------------------------------")
|
||||
|
||||
return app, celery
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import traceback
|
||||
from flask import current_app
|
||||
from celery import states
|
||||
from sqlalchemy.exc import SQLAlchemyError, InterfaceError, OperationalError
|
||||
from redis.exceptions import ConnectionError as RedisConnectionError, TimeoutError as RedisTimeoutError
|
||||
|
||||
from common.utils.config_field_types import TaggingFields
|
||||
from common.utils.database import Database
|
||||
@@ -21,7 +22,9 @@ from common.utils.execution_progress import ExecutionProgressTracker
|
||||
|
||||
|
||||
# Healthcheck task
|
||||
@current_celery.task(name='ping', queue='llm_interactions')
|
||||
@current_celery.task(bind=True, name='ping', queue='llm_interactions',
|
||||
autoretry_for=(InterfaceError, OperationalError, RedisConnectionError, RedisTimeoutError, OSError),
|
||||
retry_backoff=True, retry_jitter=True, max_retries=5)
|
||||
def ping():
|
||||
return 'pong'
|
||||
|
||||
@@ -215,7 +218,9 @@ def prepare_arguments(specialist: Any, arguments: Dict[str, Any]) -> Dict[str, A
|
||||
raise ArgumentPreparationError(str(e))
|
||||
|
||||
|
||||
@current_celery.task(bind=True, name='execute_specialist', queue='llm_interactions', autoretry_for=(InterfaceError, OperationalError), retry_backoff=True, retry_jitter=True, max_retries=5)
|
||||
@current_celery.task(bind=True, name='execute_specialist', queue='llm_interactions',
|
||||
autoretry_for=(InterfaceError, OperationalError),
|
||||
retry_backoff=True, retry_jitter=True, max_retries=5)
|
||||
def execute_specialist(self, tenant_id: int, specialist_id: int, arguments: Dict[str, Any],
|
||||
session_id: str, user_timezone: str) -> dict:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user