I have job delayed in default redis queue and i want to remove it when model's status is updated to some value.
So i'm using updated observer:
/**
* If status change from active to draft remove delayed job
*
* @param Draw $draw
*/
public function updated(Draw $draw)
{
$originalStatus = $draw->getOriginal('status');
$newStatus = $draw->status;
if ($originalStatus === 'active' && $newStatus === 'draft') {
$job = Redis::get('App\Models\Draw:' . $draw->id);
$job->delete();
}
}
With this code $job
is always null. Do you know how i can get my job from redis default queue ? I don't know what redis key i need to use to fetch the specific job