Pārlūkot izejas kodu

fix: 改用 $this->onQueue('pdf') 方式(和 GenerateExamPdfJob 一样)

大侠咬超人 1 nedēļu atpakaļ
vecāks
revīzija
d0de3702f2
1 mainītis faili ar 3 papildinājumiem un 5 dzēšanām
  1. 3 5
      app/Jobs/GenerateAnalysisPdfJob.php

+ 3 - 5
app/Jobs/GenerateAnalysisPdfJob.php

@@ -14,11 +14,6 @@ class GenerateAnalysisPdfJob implements ShouldQueue
 {
 {
     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
 
 
-    /**
-     * 指定队列名称 - PDF 生成需要 Chrome,必须在 pdf 队列处理
-     */
-    public string $queue = 'pdf';
-
     public string $paperId;
     public string $paperId;
     public string $studentId;
     public string $studentId;
     public ?string $recordId;
     public ?string $recordId;
@@ -29,6 +24,9 @@ class GenerateAnalysisPdfJob implements ShouldQueue
         $this->paperId = $paperId;
         $this->paperId = $paperId;
         $this->studentId = $studentId;
         $this->studentId = $studentId;
         $this->recordId = $recordId;
         $this->recordId = $recordId;
+
+        // 指定使用 pdf 队列,由独立的 pdf-worker 容器处理
+        $this->onQueue('pdf');
     }
     }
 
 
     public function handle(ExamPdfExportService $pdfExportService): void
     public function handle(ExamPdfExportService $pdfExportService): void