1

I can't run a cron job every minute, because even if I set the setting to run once per minute 1/1, the system defaults it back to 1/15 after some time.

I've created a cron target script, that is meant to run twice per minute over a 15 times using sleep(), but I'm getting a 504 Gateway Time-out error less than 5 minutes into the script.

s there another way of getting it to work(tricking it) using php to prevent a timeout?

Daniel
  • 34,125
  • 17
  • 102
  • 150
  • if do you run php with fastcgi maybe change the fastcgi timeout: http://stackoverflow.com/a/17511476/1721486 – spinsch Aug 08 '14 at 17:33
  • 1
    Don't use `1/1 * * * *`, I'm not even sure if it does what you think. Use `* * * * *` to make it run every minute. – Havenard Aug 08 '14 at 17:34
  • is it possible to re-direct a `lynx -dump http://mypage.com/cron` to itself from within the same php file 14 times? – Daniel Aug 10 '14 at 22:22

1 Answers1

0

this is the function I'm using (wanted to run 10 times per minute)

I've logged how often it runs, and even though I still get 504 Gateway Time-out, the log proves that the cron function runs 150 times

function cron(){
    $cronFreq = 15;
    $perMinute = 10;
    for ( $repeat = 0; $repeat < $cronFreq*$perMinute; $repeat++) {
        $this->executeCronJob();
        sleep(60/$perMinute);
    }
}
Daniel
  • 34,125
  • 17
  • 102
  • 150