/
tsps
/
core
Обзор
Документация
Войти
/
tsps
/
core
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
app/services/case_loader_client.py
24 строки
1002 B
Василий Петров
Вызов case_loader
31 янв 2026, 19:49
31 янв 2026, 19:49
77442a1
Код
Авторство
О чём код?
import logging from httpx import Client from app.core.config import config logger = logging.getLogger(__name__) def _create_http_client(): return Client(timeout=10.0) def notify_case_loader(document_import_job_id: int) -> None: try: with _create_http_client() as client: response = client.post( f"{config.CASE_LOADER_URL}/load-documents", json={"document_import_job_id": document_import_job_id} ) if response.status_code == 202: logger.info(f"Успешно отправлена задача {document_import_job_id} в case_loader") else: logger.error( f"case_loader вернул статус {response.status_code} для задачи {document_import_job_id}: {response.text}" ) except Exception as e: logger.exception(f"Не удалось вызвать case_loader для задачи {document_import_job_id}: {e}")