|
|
@@ -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);
|
|
|
|