mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-31 12:47:58 +00:00
🐛(summary) fix failure webhook notification
Computation was off by 1. Also improve the logging.
This commit is contained in:
@@ -31,6 +31,7 @@ and this project adheres to
|
|||||||
- ⬆️(dependencies) update vite to v7.3.2 [SECURITY]
|
- ⬆️(dependencies) update vite to v7.3.2 [SECURITY]
|
||||||
- ⬆️(dependencies) update django to v5.2.13 [SECURITY]
|
- ⬆️(dependencies) update django to v5.2.13 [SECURITY]
|
||||||
- 🔒(backend) rely on backend to allow participant update their metadata
|
- 🔒(backend) rely on backend to allow participant update their metadata
|
||||||
|
- 🐛(summary) fix failure webhook notification #1233
|
||||||
|
|
||||||
## [1.13.0] - 2026-03-31
|
## [1.13.0] - 2026-03-31
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ metadata_manager = MetadataManager()
|
|||||||
|
|
||||||
logger = get_task_logger(__name__)
|
logger = get_task_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
celery = Celery(
|
celery = Celery(
|
||||||
__name__,
|
__name__,
|
||||||
broker=settings.celery_broker_url,
|
broker=settings.celery_broker_url,
|
||||||
@@ -497,13 +496,22 @@ def handle_transcribe_v2_failed(
|
|||||||
This function is triggered when the transcribe_v2_task fails.
|
This function is triggered when the transcribe_v2_task fails.
|
||||||
It sends a webhook failure payload to notify the client of the failure.
|
It sends a webhook failure payload to notify the client of the failure.
|
||||||
"""
|
"""
|
||||||
task = sender
|
n_retries_left = sender.max_retries - sender.request.retries - 1
|
||||||
# If retries are exhausted:
|
if n_retries_left > 0:
|
||||||
if task.request.retries >= task.max_retries:
|
logger.info(
|
||||||
|
"Transcribe task %s failed, %s retries left.",
|
||||||
|
task_id,
|
||||||
|
n_retries_left,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
logger.warn(
|
||||||
|
"Transcribe task %s failed, no more retries left, sending failure webhook.",
|
||||||
|
task_id,
|
||||||
|
)
|
||||||
call_webhook_v2_task.apply_async(
|
call_webhook_v2_task.apply_async(
|
||||||
args=[
|
args=[
|
||||||
TranscribeWebhookFailurePayload(
|
TranscribeWebhookFailurePayload(
|
||||||
job_id=task.id,
|
job_id=task_id,
|
||||||
error_code="unknown_error",
|
error_code="unknown_error",
|
||||||
).model_dump(),
|
).model_dump(),
|
||||||
args[0]["tenant_id"],
|
args[0]["tenant_id"],
|
||||||
@@ -562,13 +570,22 @@ def handle_summarize_v2_failed(
|
|||||||
This function is triggered when the summarize_v2_task fails.
|
This function is triggered when the summarize_v2_task fails.
|
||||||
It sends a webhook failure payload to notify the client of the failure.
|
It sends a webhook failure payload to notify the client of the failure.
|
||||||
"""
|
"""
|
||||||
task = sender
|
n_retries_left = sender.max_retries - sender.request.retries - 1
|
||||||
# If retries are exhausted:
|
if n_retries_left > 0:
|
||||||
if task.request.retries >= task.max_retries:
|
logger.info(
|
||||||
|
"Summary task %s failed, %s retries left.",
|
||||||
|
task_id,
|
||||||
|
n_retries_left,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
logger.warn(
|
||||||
|
"Summary task %s failed, no more retries left, sending failure webhook.",
|
||||||
|
task_id,
|
||||||
|
)
|
||||||
call_webhook_v2_task.apply_async(
|
call_webhook_v2_task.apply_async(
|
||||||
args=[
|
args=[
|
||||||
SummarizeWebhookFailurePayload(
|
SummarizeWebhookFailurePayload(
|
||||||
job_id=task.id,
|
job_id=task_id,
|
||||||
error_code="unknown_error",
|
error_code="unknown_error",
|
||||||
).model_dump(),
|
).model_dump(),
|
||||||
args[0]["tenant_id"],
|
args[0]["tenant_id"],
|
||||||
|
|||||||
Reference in New Issue
Block a user