Deploy Ladill Meet / deploy (push) Successful in 1m1s
Queue summarization on session end (with a short delay for late captions), keep recording-ready as a refresh path, and unique the summary job so end plus recording do not double-process the same transcript.
39 lines
870 B
PHP
39 lines
870 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\Transcript;
|
|
use App\Services\Meet\MeetAiService;
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
|
|
class GenerateAiSummary implements ShouldBeUnique, ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public int $tries = 2;
|
|
|
|
/** Prevent end-of-meeting + recording-ready from running two summaries at once. */
|
|
public int $uniqueFor = 180;
|
|
|
|
public function __construct(
|
|
public int $transcriptId,
|
|
) {}
|
|
|
|
public function uniqueId(): string
|
|
{
|
|
return 'meet-ai-summary:'.$this->transcriptId;
|
|
}
|
|
|
|
public function handle(MeetAiService $ai): void
|
|
{
|
|
$transcript = Transcript::find($this->transcriptId);
|
|
if (! $transcript) {
|
|
return;
|
|
}
|
|
|
|
$ai->summarize($transcript);
|
|
}
|
|
}
|