From ea8c162793291dcc5ed8bb3879b7652137f675d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=B6=E8=BE=89?= Date: Mon, 13 Nov 2017 17:41:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=97=B6=E9=97=B4bug=E4=BF=AE=E5=A4=8D):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++++++++ src/jobs/Job.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a74ac66..76627b8 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,17 @@ CREATE TABLE IF NOT EXISTS `tb_queue` ( yii migrate/up --migrationPath=@graychen/yii2/queue/backend/migrations ``` ## Usage +### Config -> main.php +``` +'controllerMap' => [ + 'migrate' => [ + 'class' => 'yii\console\controllers\MigrateController', + 'migrationPath' => [ + '@graychen/yii2/queue/backend/migrations' + ], + ], + ], +``` ### Config Module in components part ``` php 'queue' => [ diff --git a/src/jobs/Job.php b/src/jobs/Job.php index 3472de1..5806cf1 100644 --- a/src/jobs/Job.php +++ b/src/jobs/Job.php @@ -18,7 +18,7 @@ public function init() $queue->name=$this->getName(); $queue->catalog=$this->getCatalog(); $queue->description=$this->getDescription(); - $queue->exec_time=$delay; + $queue->exec_time=$delay + time(); $queue->queue_id=$event->id; $queue->save(); });