Raise queue retry_after above the job timeout, recover orphaned runs, allow stop/restart with any engine, and keep finished transcripts searchable in the recordings list.
24 lines
523 B
PHP
24 lines
523 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Recording;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class TranscriptionStatusController extends Controller
|
|
{
|
|
/**
|
|
* Live transcription progress for polling.
|
|
*/
|
|
public function __invoke(Recording $recording): JsonResponse
|
|
{
|
|
$recording = $recording->fresh();
|
|
|
|
if ($recording->recoverOrphanedTranscription()) {
|
|
$recording->refresh();
|
|
}
|
|
|
|
return response()->json($recording->transcriptionStatusPayload());
|
|
}
|
|
}
|