Increase timeouts for large-file transcription
- LocalAI client timeout: 600s -> 3600s - Summarizer timeout: 600s -> 3600s - Add task_time_limit=14400s (4h) and soft_time_limit=13500s to transcription task
This commit is contained in:
@@ -48,7 +48,7 @@ class LocalAIClient:
|
|||||||
api_url: Optional[str] = None,
|
api_url: Optional[str] = None,
|
||||||
api_key: Optional[str] = None,
|
api_key: Optional[str] = None,
|
||||||
model: Optional[str] = None,
|
model: Optional[str] = None,
|
||||||
timeout: float = 600.0,
|
timeout: float = 3600.0,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class SummarizerClient:
|
|||||||
api_url: Optional[str] = None,
|
api_url: Optional[str] = None,
|
||||||
api_key: Optional[str] = None,
|
api_key: Optional[str] = None,
|
||||||
model: Optional[str] = None,
|
model: Optional[str] = None,
|
||||||
timeout: float = 600.0,
|
timeout: float = 3600.0,
|
||||||
):
|
):
|
||||||
self.api_url = (api_url or os.getenv("SUMMARIZER_API_URL")).strip().rstrip("/")
|
self.api_url = (api_url or os.getenv("SUMMARIZER_API_URL")).strip().rstrip("/")
|
||||||
self.api_key = api_key or os.getenv("SUMMARIZER_API_KEY") or None
|
self.api_key = api_key or os.getenv("SUMMARIZER_API_KEY") or None
|
||||||
|
|||||||
@@ -251,6 +251,8 @@ def send_error_email(to: str, error_message: str, task_id: str):
|
|||||||
name="scraibe.tasks.process_transcription_task",
|
name="scraibe.tasks.process_transcription_task",
|
||||||
bind=True,
|
bind=True,
|
||||||
max_retries=1,
|
max_retries=1,
|
||||||
|
task_time_limit=14400, # 4 hours
|
||||||
|
task_soft_time_limit=13500, # warn at 3h45m
|
||||||
)
|
)
|
||||||
def process_transcription_task(
|
def process_transcription_task(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user