Changeset 2394
- Timestamp:
- 08/28/08 14:37:28 (4 months ago)
- Location:
- trunk/htdocs/system/classes
- Files:
-
- 2 modified
-
apccache.php (modified) (1 diff)
-
crontab.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/htdocs/system/classes/apccache.php
r2076 r2394 101 101 return null; 102 102 } 103 apc_store( "$group:$name", $value, $expiry);103 apc_store( "$group:$name", $value, intval($expiry) ); 104 104 } 105 105 -
trunk/htdocs/system/classes/crontab.php
r2136 r2394 17 17 { 18 18 // check if it's time to run crons, and if crons are already running. 19 $next_cron = doubleval( Options::get('next_cron') );19 $next_cron = intval( Options::get('next_cron') ); 20 20 if ( ( $next_cron > time() ) 21 21 || ( Options::get('cron_running') && Options::get('cron_running') > microtime(true) ) … … 25 25 26 26 // cron_running will timeout in 10 minutes 27 // round cron_running to 4 decimals 27 28 $run_time = microtime(true) + 600; 29 $run_time = sprintf("%.4f", $run_time); 28 30 Options::set('cron_running', $run_time); 29 31 … … 44 46 } 45 47 48 $time = time(); 46 49 $crons = DB::get_results( 47 50 'SELECT * FROM {crontab} WHERE start_time <= ? AND next_run <= ?', 48 array( time(), time()),51 array( $time, $time ), 49 52 'CronJob' 50 53 ); … … 67 70 function act_poll_cron() 68 71 { 69 $time = $this->handler_vars['time'];72 $time = doubleval($this->handler_vars['time']); 70 73 if ( $time != Options::get('cron_running') ) { 71 74 return; … … 75 78 set_time_limit(600); 76 79 80 $time = time(); 77 81 $crons = DB::get_results( 78 82 'SELECT * FROM {crontab} WHERE start_time <= ? AND next_run <= ?', 79 array( time(), time()),83 array( $time, $time ), 80 84 'CronJob' 81 85 ); … … 88 92 89 93 // set the next run time to the lowest next_run OR a max of one day. 94 // @todo next_cron should be the actuall next run time and update it when new crons are 95 // added instead of just maxing out at one day.. 90 96 $next_cron = DB::get_value( 'SELECT next_run FROM {crontab} ORDER BY next_run ASC LIMIT 1', array() ); 91 97 Options::set('next_cron', min( (int) $next_cron, time() + 86400 ) );
