2

I'm on shared hosting that will only allow me to schedule cron jobs as frequently as 5 minutes apart. In Laravel's documentation, it notes that the cron job should be run per minute. My schedule has a task running everyFiveMinutes().

It doesn't seem to be running, so I'm trying to figure out if it's because of this issue.

I'm not sure of the inner workings of task scheduling, but I can see how - if "everyFiveMinutes" literally looks for the number 5 or 0 in the time, it's possible that my shared hosting's cron job is running a different every 5 minutes, say minute 1 and minute 6.

But, if everyFiveMinutes just looks to see if there's something that hasn't been processed in 5 minutes (and I don't see how without a DB table), then this wouldn't be the problem and I'd need to search somewhere else. Any thoughts? Thanks!

Jeremy L.
  • 853
  • 8
  • 15
  • Can you add a log in your schedular to verify if your scheduler is running every 5 mins? – Jaswinder Singh Feb 19 '21 at 05:24
  • 1
    you potentially could set your task to "every minute", since cron is only hitting this every 5 minutes, it will run this task every time it runs – lagbox Feb 19 '21 at 06:01
  • 1
    Wow @lagbox, that’s a perfectly logical solution and I’m hating myself for not thinking of it first. Thanks! – Jeremy L. Feb 20 '21 at 17:16
  • 1
    np, since the smallest increment is one minute, "everyMinute" should just mean every time the scheduler runs ... the reasoning behind having to run the scheduler every minute is it needs to be able to compare the current time with the scheduled tasks time within a certain range and based on the current minute ... it is not tracking that a task was ran every five minutes, it just checks a current time to see if it falls into that 5 minute increment – lagbox Feb 20 '21 at 18:11

0 Answers0