It seems like you have the basic setup correct, but there are a few things we can check and clarify to ensure your queue is working properly on Forge.
-
Ensure your cron job is set up correctly on Forge. Forge should automatically set up the
schedule:runcommand to run every minute, but it's worth checking that the cron job is indeed set up and running. You can check this in the Forge dashboard under the "Scheduler" section. -
Check your scheduled task definition. Make sure that the
PodcastGetRSSjob is being dispatched correctly. YourKernel.phplooks correct, but ensure that the job itself doesn't have any issues that could prevent it from being dispatched. -
Verify that your queue worker is running. In Forge, under the "Queue" section, make sure that your worker is running and that it's set to listen to the correct queue connection and queue name (if you're using named queues).
-
Check your
.envfile and cache. Make sure that your.envfile on the server actually has theQUEUE_CONNECTION=databaseline and that the configuration is not being cached with an old value. You can clear the configuration cache by runningphp artisan config:clear. -
Monitor your queue jobs table. Since you're using the
databasequeue connection, check thejobstable in your database to see if jobs are being inserted when the scheduled task runs. -
Check for failed jobs. Also, check the
failed_jobstable to see if any jobs have failed to run. This can give you insight into any issues that might be occurring. -
Regarding the deployment script. The
queue:restartcommand is necessary when you deploy new code that could affect how your jobs run. It gracefully restarts all of the queue workers so that they will start using the new code. However, if you're not changing code related to your jobs, it's not strictly necessary to run it every time.
Here's a simplified checklist:
- Verify cron job for
schedule:runis set up in Forge. - Ensure
PodcastGetRSSjob dispatches correctly. - Confirm the queue worker is running and configured correctly in Forge.
- Check
.envfile and clear config cache if necessary. - Monitor
jobsandfailed_jobstables in the database. - Use
queue:restartin deployment when job-related code changes.
If after checking all these points you're still facing issues, you might want to look into the logs for any errors or stack traces that can provide more information about what's going wrong. You can check the Laravel logs typically found in storage/logs/ or any other logging services you might have configured.