- Timestamp:
- 06/25/10 14:15:07 (11 years ago)
- Location:
- trunk/server/www/app
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/www/app/config/core.php.default
r318 r374 279 279 Configure::write('Job.locktime', (5 * 60)); 280 280 } 281 /** 282 * The number of times a job is allowed to fail before it will not run again 283 */ 284 Configure:write('Job.maxfailures', 5); 281 285 /** 282 286 * The number of seconds since the last poll of a factory before it is dropped from the front page. -
trunk/server/www/app/config/sql/schema.php
r372 r374 1 1 <?php 2 2 /* SVN FILE: $Id$ */ 3 /* App schema generated on: 2010-06- 08 12:06:45 : 1275992085*/3 /* App schema generated on: 2010-06-25 14:06:50 : 1277467250*/ 4 4 class AppSchema extends CakeSchema { 5 5 var $name = 'App'; … … 111 111 'factory_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36), 112 112 'state' => array('type' => 'integer', 'null' => false, 'default' => '1'), 113 'failures' => array('type' => 'integer', 'null' => false, 'default' => '0'), 113 114 'locked' => array('type' => 'datetime', 'null' => false, 'default' => '0000-00-00 00:00:00'), 114 115 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL), -
trunk/server/www/app/controllers/jobs_controller.php
r373 r374 521 521 } 522 522 523 // If a factory ID has been set, this job has been handed out earlier. Increase the failure count 524 if ($job['Job']['factory_id']) { 525 $job['Job']['failures'] += 1; 526 527 // If this job has failed too many times, change it's state and prompt the factory to poll again 528 if ($job['Job']['failures'] > Configure::read('Job.maxfailures')) { 529 $job['Job']['state'] = Job::STATE_FAILED; 530 $this->Job->save($job); 531 532 $this->log(sprintf("Job ID %s failed %s times. Stopping job.", $job['Job']['id'], Configure::read('Job.maxfailures')), LOG_DEBUG); 533 return null; 534 } 535 } 536 523 537 $job['Job']['locked'] = date('Y-m-d H:i:s', time() + Configure::read('Job.locktime')); 524 538 $job['Job']['factory_id'] = $factory['Factory']['id'];
Note: See TracChangeset
for help on using the changeset viewer.