zhuravljov / yii2-queue-monitor

Yii2 Queue Analytics Module
BSD 3-Clause "New" or "Revised" License
102 stars 24 forks source link

Redis driver not be supported #21

Closed JimChenWYU closed 4 years ago

JimChenWYU commented 4 years ago

Thanks for the greatest package.

In https://github.com/zhuravljov/yii2-queue-monitor/issues/16#issuecomment-489755076

You said it is support for redis driver, but i tried it and it can not work.

In \zhuravljov\yii\queue\monitor\Env I found the problem,

$this->db = Instance::ensure($this->db, Connection::class);

the second parameter of Instance::ensure should be yii\redis\Connnection, that can be work for redis driver.

Insolita commented 4 years ago

It supports queue with redis driver, but it store statistic in db always. You may use redis for configuration yii2-queue component. This plugin provides only persistent logs about queued/active/failed/ tasks that was pushed and executeted with yii2-queue

JimChenWYU commented 4 years ago

@Insolita OK, I want to store statistic in redis, but it is not supported.

Insolita commented 4 years ago

Yes. And I think that redis is not good storage for this kind of data, because it may contain hundreds of thousands records, and even more. But monitor realization is quite simple, just see https://github.com/zhuravljov/yii2-queue-monitor/blob/master/src/JobMonitor.php You can write own behavior for store it in redis

JimChenWYU commented 4 years ago

@Insolita Thanks your answer.