Ver Fonte

choose db queue if gather than 200 records to export

Alexander Musikhin há 2 anos atrás
pai
commit
7af964e385

+ 6 - 1
app/Http/Controllers/ExportController.php

@@ -52,7 +52,12 @@ class ExportController extends Controller
 
 
         $filename = 'Наш_Двор_' . date('YmdHis') . '.docx';
-        GenerateDocxJob::dispatch($vars_for_template, count($products), $filename, $request->template);
+        if($products->count() > 200){
+            GenerateDocxJob::dispatch($vars_for_template, count($products), $filename, $request->template)->onConnection('database');
+        } else {
+            GenerateDocxJob::dispatch($vars_for_template, count($products), $filename, $request->template)->onConnection('sync');
+        }
+
 
         Log::notice('Created export job. Execution time: ' . microtime(true) - LARAVEL_START);
 

BIN
storage/templates/одиночный.docx