Changeset 411


Ignore:
Timestamp:
06/23/11 21:18:44 (10 years ago)
Author:
sander
Message:

Added console interface to re-run jobs

Location:
trunk/server/www/app
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/www/app/models/job.php

    r372 r411  
    4747        public $actsAs = array('Containable'); 
    4848 
     49        /** 
     50         * Delete any existing result and re-schedule the job for a fresh rendering 
     51         */ 
     52        public function rerun() 
     53        { 
     54                if ($result_id = $this->field('result_id')) { 
     55                        $this->Result->delete($result_id); 
     56                } 
     57 
     58                $this->save(array( 
     59                        'factory_id' => '', 
     60                        'state'      => self::STATE_QUEUED, 
     61                        'failures'   => 0, 
     62                        'locked'     => '0000-00-00 00:00:00', 
     63                )); 
     64        } 
     65 
    4966        /** 
    5067         * Manually update the counterCaches for Request 
  • trunk/server/www/app/models/result.php

    r383 r411  
    5757         * A result can have multiple ODF validators 
    5858         */ 
    59         public $hasMany = array('Validator' => array('foreignKey' => 'parent_id')); 
     59        public $hasMany = array('Validator' => array('foreignKey' => 'parent_id', 'dependent' => true)); 
    6060 
    6161        /** @var array The result is a file */ 
Note: See TracChangeset for help on using the changeset viewer.