fix: use allow_join_result for celery subtask result retrieval
Celery doesn't allow calling result.get() within a task by default to prevent deadlocks. Use allow_join_result() context manager since we've already confirmed the task is complete via ready() polling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bf1c321088
commit
e5ff124140
1 changed files with 10 additions and 4 deletions
|
|
@ -50,6 +50,7 @@ class VideoRendererService:
|
|||
Raises:
|
||||
FFmpegExecutionError: If the command fails
|
||||
"""
|
||||
from celery.result import allow_join_result
|
||||
from ..tasks.ffmpeg_operations import run_ffmpeg_command
|
||||
|
||||
# Dispatch to ffmpeg queue
|
||||
|
|
@ -62,8 +63,10 @@ class VideoRendererService:
|
|||
while not task_result.ready():
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
# Get result (should be ready, short timeout for safety)
|
||||
result = task_result.get(timeout=30)
|
||||
# Get result - use allow_join_result since we're calling from within a task
|
||||
# This is safe because we've already confirmed the task is complete via ready()
|
||||
with allow_join_result():
|
||||
result = task_result.get(timeout=30)
|
||||
|
||||
if not result['success']:
|
||||
raise FFmpegExecutionError(
|
||||
|
|
@ -85,6 +88,7 @@ class VideoRendererService:
|
|||
Raises:
|
||||
FFmpegExecutionError: If the command fails
|
||||
"""
|
||||
from celery.result import allow_join_result
|
||||
from ..tasks.ffmpeg_operations import run_ffprobe_command
|
||||
|
||||
# Dispatch to ffmpeg queue
|
||||
|
|
@ -97,8 +101,10 @@ class VideoRendererService:
|
|||
while not task_result.ready():
|
||||
await asyncio.sleep(0.2)
|
||||
|
||||
# Get result
|
||||
result = task_result.get(timeout=30)
|
||||
# Get result - use allow_join_result since we're calling from within a task
|
||||
# This is safe because we've already confirmed the task is complete via ready()
|
||||
with allow_join_result():
|
||||
result = task_result.get(timeout=30)
|
||||
|
||||
if not result['success']:
|
||||
raise FFmpegExecutionError(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue