]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавляем ttr переводим на RetryableJobInterface
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 17 Oct 2025 12:10:33 +0000 (15:10 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 17 Oct 2025 12:10:33 +0000 (15:10 +0300)
erp24/api2/config/api2.config.php
erp24/config/console.php
erp24/config/web.php
erp24/jobs/SendRequestUploadDataToJob.php

index ddc74d7b08c93e70dc779afa69a4193efd0ab3f1..d284053ac959db149ec5e701270e6fd3c1e44828 100644 (file)
@@ -67,7 +67,7 @@ return [
             'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@' . (getenv('RABBIT_HOST') ?: 'localhost') . ':5672',
             'queueName' => 'telegram-queue',
             'as log' => \yii\queue\LogBehavior::class,
-            'ttr' => 300, // Время для выполнения задания
+            'ttr' => 600, // Время для выполнения задания
             'attempts' => 3, // Количество попыток
             'exchangeName' => 'telegram-exchange',
         ],
index 22b02f94c33505396f7b1195aab9f05829a2bc19..5b0fcb51dfd590054ebb441da2225dc3b341d39a 100755 (executable)
@@ -46,12 +46,9 @@ $config = [
             'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@' . $params['RABBIT_HOST'] . ':5672',
             'queueName' => 'telegram-queue',
             'as log' => \yii\queue\LogBehavior::class,
-            'ttr' => 300, // Время для выполнения задания
+            'ttr' => 600, // Время для выполнения задания
             'attempts' => 3, // Количество попыток
             'exchangeName' => 'telegram-exchange',
-
-
-
         ],
         'cache' => [
             'class' => 'yii\caching\FileCache',
index 37c327a73b7c3c0a402616a3345a6b538917cb14..e58b6228d003f6dd64e6ee3e8f174a3bb82f4536 100644 (file)
@@ -46,17 +46,17 @@ $config = [
             'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@' . $params['RABBIT_HOST'] . ':5672',
             'queueName' => 'telegram-queue',
             'as log' => \yii\queue\LogBehavior::class,
-            'ttr' => 300, // Время для выполнения задания
+            'ttr' => 600, // Время для выполнения задания
             'attempts' => 3, // Количество попыток
             'exchangeName' => 'telegram-exchange',
 
 
 
         ],
-        'puppeteer' => [
-            'class' => \yii_app\services\FlowwowService::class,
-            'endpoint' => 'http://node-yii_erp24:3030',
-        ],
+//        'puppeteer' => [
+//            'class' => \yii_app\services\FlowwowService::class,
+//            'endpoint' => 'http://node-yii_erp24:3030',
+//        ],
         'cache' => [
             'class' => 'yii\caching\FileCache',
         ],
index 9cbf01213ad79b21167a7a796aba9e12fdd95abd..b74098609dab5ffd26e0c051806785af5bf81b14 100644 (file)
@@ -7,10 +7,10 @@ namespace yii_app\jobs;
 
 
 
-use yii\queue\JobInterface;
+use yii\queue\RetryableJobInterface;
 use yii_app\services\UploadService;
 
-class SendRequestUploadDataToJob extends \yii\base\BaseObject implements JobInterface
+class SendRequestUploadDataToJob implements RetryableJobInterface
 {
     public $decodingResult;
     public function execute($queue) {
@@ -20,7 +20,12 @@ class SendRequestUploadDataToJob extends \yii\base\BaseObject implements JobInte
 
     }
 
+    public function getTtr() {
+        return 600;
+    }
 
-
+    public function canRetry($attempt, $error) {
+        return $attempt < 3;
+    }
 
 }