Closed ghost closed 5 years ago
duplicate of https://github.com/laravel/telescope/issues/503
The job is not running forever, I have added $tries and $timeout to the job..
In my app I am dispatching the job from an Observer and then Horizon will show the status as a success
but in Telescope still in a pending
status.When I dispatch it from else where Telescope shows the status successfully same as Horizon.
@themsaid
How to reproduce this issue?
1 - run php artisan horizon
before dispatching any job..
2 - dispatch a job from Observer or Events listeners..
It seems that Telescope doesn't catch jobs's events probably in this scenario...
Same issue here. Horizon says it is finished successfully, but telescope stays pending forever.
@themsaid
is this on your radar?
I can't replicate it no matter what I test, horizon and telescope are running nicely together. I've seen people report it and then say it's working fine now, so perhaps it's a worker reading old code or something.
I did a fresh laravel install with the same configuration as my old project ( which has the issue ) and everything is working nicely between horizon and telescope like you said.
I will dig more and see whats happening with my old project.
I don't know if I should write this to a separate issue or not.. but an issue I have found when re-queuing the same job again.. telescope shows an empty queue ( for any dispatched job comes after the first one ).
class ProcessPodcast implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* @var array
*/
private $params;
/**
* AJob constructor.
*
* @param $param1
*/
public function __construct($param1)
{
$this->onQueue('someQueue');
$this->params = func_get_args();
}
public function handle()
{
try {
/**
* going to do a lot of logic here or throw exception that may cause it to requeue
*/
throw new \Exception('Requeue');
} catch (\Exception $exception) {
// check for "Requeue" and dispatch a new job.
if ($exception->getMessage() === 'Requeue') {
$this->dispatch(...$this->params)->onQueue('someQueue')->delay(5);
}
}
}
}
Just incase anyone finds this and is looking for an answer. I had the same issue with Telescope and AWS/SQS queues and found that the problem was fixed by restarting the queue workers.
I am using Redis and Horizon to mange my queues..
When I use
php artisan queue:work redis
to process the jobs , the jobs's status in both Horizon and Telescope is successfully changed tosuccess
status.On the other hand, when using
php artisan horizon
the jobs are in asuccess
status in Horizon, yet Telescope shows these jobs as in apending
status!