Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to push job into Redis Queue from inside a Redis Multi block #355

Open
luqmansungkar opened this issue Oct 4, 2019 · 0 comments
Labels
type:enhancement Enhancement

Comments

@luqmansungkar
Copy link

If I have code that look like this:

<?php

$redis = \Yii::$app->redis;
$redis->multi();
\Yii::$app->queue->push(new SomeJob());
\Yii::$app->queue->push(new SomeJob());
$redis->exec();

The job will be pushed with QUEUED as the id, and only the last job that will be run. That's because this line read from to use an incremented number as the job id.

I propose to use something that doesn't read from redis as the value for id, such as uniqid.

Also, can I know the reason why we used hset to store the job message and only push the job id to the list, instead of directly pushing the id along with the job message to list and not using hset?

@samdark samdark added this to the 2.3.1 milestone Dec 2, 2019
@samdark samdark added the type:enhancement Enhancement label Dec 2, 2019
@samdark samdark modified the milestones: 2.3.1, 2.3.2 Dec 23, 2020
@samdark samdark removed this from the 2.3.2 milestone Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants