Skip to content

Commit 74ef57f

Browse files
committed
add queue manager
1 parent c0b4c24 commit 74ef57f

File tree

7 files changed

+215
-13
lines changed

7 files changed

+215
-13
lines changed

backend/config/main.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
],
2323
],
2424
],
25+
'queuemanager' => [
26+
'class' => \ignatenkovnikita\queuemanager\QueueManager::class
27+
]
2528
],
2629
'components' => [
2730
'request' => [

backend/views/layouts/main.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
"url" => ['/log/index'],
7878
"icon" => "bug",
7979
],
80+
[
81+
"label" => \Yii::t('app-model', 'Queue Manager'),
82+
"url" => ['/queuemanager/default/index'],
83+
"icon" => "tasks",
84+
],
8085
],
8186
],
8287
],

common/config/main.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
],
5353
],
5454
],
55+
'queue' => [
56+
'class' => \yii\queue\db\Queue::class,
57+
'db' => 'db', // DB connection component or its config
58+
'tableName' => '{{%queue}}', // Table name
59+
'channel' => 'default', // Queue channel key
60+
'mutex' => \yii\mutex\MysqlMutex::class, // Mutex used to sync queries
61+
'as log' => \yii\queue\LogBehavior::class,
62+
'as quuemanager' => \ignatenkovnikita\queuemanager\behaviors\QueueManagerBehavior::class
63+
// Other driver options
64+
],
5565
],
5666
'modules' => [
5767
'user' => [

common/messages/ru-RU/app-model.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* NOTE: this file must be saved in UTF-8 encoding.
1818
*/
1919
return [
20+
'Queue Manager' => 'Менеджер очереди',
2021
'Email Form' => 'Email Form',
2122
'Log' => 'Лог',
2223
'Log out' => 'Выход',

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"yiister/yii2-gentelella": "~1.0",
1919
"yiisoft/yii2-redis": "^2.0",
2020
"yiisoft/yii2-queue": "^2.0",
21-
"himiklab/yii2-recaptcha-widget": "^1.2"
21+
"himiklab/yii2-recaptcha-widget": "^1.2",
22+
"ignatenkovnikita/yii2-queuemanager": "dev-master",
23+
"yiisoft/yii2-jui": "^2.0"
2224
},
2325
"require-dev": {
2426
"yiisoft/yii2-debug": "~2.0.0",

composer.lock

Lines changed: 192 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

console/config/main.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
return [
1010
'id' => 'app-console',
1111
'basePath' => dirname(__DIR__),
12-
'bootstrap' => ['log'],
12+
'bootstrap' => ['log', 'queue'],
1313
'controllerNamespace' => 'console\controllers',
1414
'aliases' => [
1515
'@bower' => '@vendor/bower-asset',
@@ -30,14 +30,6 @@
3030
],
3131
],
3232
'components' => [
33-
'log' => [
34-
'targets' => [
35-
[
36-
'class' => 'yii\log\FileTarget',
37-
'levels' => ['error', 'warning'],
38-
],
39-
],
40-
],
4133
],
4234
'params' => $params,
4335
];

0 commit comments

Comments
 (0)