Amir-Homayoun
Amir-Homayoun

Reputation: 21

Telescope Jobs Stuck in Pending Status

When we schedule jobs (PushNotificationJob, see below) to run every 5 seconds, majority of the jobs displayed in Telescope remain stuck in the Pending status. Please see the screenshot below:

Screenshot showing Pending status of jobs

As shown, there are multiple jobs with the Pending status. This screenshot is from a local machine, but the same issue occurs on our server, where all jobs also get stuck in Pending.

This is the code:

class Kernel extends ConsoleKernel
{
    protected function schedule(Schedule $schedule)
    {
        $schedule->job(new PushNotificationJob)->everyFiveSeconds();

        $schedule->job(new CheckClassStartedService)->everyMinute();

        $interval = DB::table('settings')->where('key', 'interval')?->value ?? 5;
        $schedule->job(new FirebaseWakeupNotificationService)->cron(StringHelper::cron24($interval));
    }
}

Based on the logs and database changes, we know the jobs are executing correctly. However, Telescope does not update the status to Processed. Execution of each job takes less than a second.

Not sure if this detail is relevant. But we are using Telescope v5.2.2, and our setup includes a Vapor serverless architecture with SQS on AWS.

When we change the frequency of PushNotificationJob to run every minute, the problem is resolved.

Any suggestions or solutions? Please let me know if I should provide any further information.

Upvotes: 0

Views: 84

Answers (0)

Related Questions