소스 검색

Fix photo archive job execution for webview downloads

Alexander Musikhin 3 주 전
부모
커밋
da721a76a4
1개의 변경된 파일8개의 추가작업 그리고 10개의 파일을 삭제
  1. 8 10
      app/Jobs/GenerateFilesPack.php

+ 8 - 10
app/Jobs/GenerateFilesPack.php

@@ -15,14 +15,6 @@ class GenerateFilesPack implements ShouldQueue
 {
     use Queueable;
 
-    /**
-     * Execute the job.
-     */
-    public function handle(): void
-    {
-        //
-    }
-
     /**
      * Create a new job instance.
      */
@@ -32,10 +24,16 @@ class GenerateFilesPack implements ShouldQueue
         private readonly int $userId,
         private readonly string $name = 'files',
     )
+    {}
+
+    /**
+     * Execute the job.
+     */
+    public function handle(): void
     {
         try {
-            $file = (new GenerateDocumentsService())->generateFilePack($this->collection, $this->userId, $name);
-            $model->documents()->attach($file->id);
+            $file = (new GenerateDocumentsService())->generateFilePack($this->collection, $this->userId, $this->name);
+            $this->model->documents()->attach($file->id);
             Log::info('Generate file pack finished!');
             event(new SendWebSocketMessageEvent('Пакет файлов готов!', $this->userId, ['success' => true, 'link' => $file->link]));
         } catch (Exception $e) {