Development

Changeset 7319

You must first sign up to be able to contribute.

Changeset 7319

Show
Ignore:
Timestamp:
02/04/08 12:10:08 (10 months ago)
Author:
xavier
Message:

sfJobQueuePlugin: typo, renamed "recuring" into "recurring"

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfJobQueuePlugin/trunk/config/schema.yml

    r7251 r7319  
    1111    tries:               integer 
    1212    max_tries:           integer 
    13     is_recuring:         boolean 
     13    is_recurring:        boolean 
    1414    # retry delay, in seconds (minimal delay between two tries of the same job) 
    1515    retry_delay:         integer 
  • plugins/sfJobQueuePlugin/trunk/lib/jobHandlers/sfJobHandler.class.php

    r7251 r7319  
    7272  public function setSfJob(sfJob $sf_job) 
    7373  { 
    74     $sf_propel_job_logger = $this->logger->getLogger('sfPropelJobLogger'); 
     74    if (sfConfig::get('app_sfJobQueuePlugin_logging_enabled', true) === true) 
     75    { 
     76      $sf_propel_job_logger = $this->logger->getLogger('sfPropelJobLogger'); 
    7577 
    76     if (is_null($sf_propel_job_logger)) 
    77     { 
    78       $sf_propel_job_logger = new sfPropelJobLogger(); 
     78      if (is_null($sf_propel_job_logger)) 
     79      { 
     80        $sf_propel_job_logger = new sfPropelJobLogger(); 
     81      } 
     82 
     83      $sf_propel_job_logger->initialize(array('sf_job_id' => $sf_job->getId())); 
     84      $this->logger->registerLogger($sf_propel_job_logger); 
    7985    } 
    80  
    81     $sf_propel_job_logger->initialize(array('sf_job_id' => $sf_job->getId())); 
    82     $this->logger->registerLogger($sf_propel_job_logger); 
    8386  } 
    8487} 
  • plugins/sfJobQueuePlugin/trunk/lib/model/sfJob.php

    r7251 r7319  
    6060    } 
    6161 
    62     if (isset($options['is_recuring'])) 
    63     { 
    64       $this->setIsRecuring($options['is_recuring']); 
    65       unset($options['is_recuring']); 
     62    if (isset($options['is_recurring'])) 
     63    { 
     64      $this->setIsRecurring($options['is_recurring']); 
     65      unset($options['is_recurring']); 
    6666    } 
    6767 
     
    7373    else 
    7474    { 
    75       $max_tries = sfConfig::get('app_sfJobQueue_max_tries', 3); 
     75      $max_tries = sfConfig::get('app_sfJobQueuePlugin_max_tries', 3); 
    7676      $this->setMaxTries($max_tries); 
    7777    } 
     
    131131    catch (Exception $e) 
    132132    { 
    133       if (!$this->getIsRecuring()) 
     133      if (!$this->getIsRecurring()) 
    134134      { 
    135135        $status = self::ERROR; 
     
    142142    } 
    143143 
    144     if (!$this->getIsRecuring()) 
     144    if (!$this->getIsRecurring()) 
    145145    { 
    146146      if (($this->getTries() >= $this->getMaxTries()) 
     
    210210 
    211211        // Max number of tries reached, change status to "error" 
    212         if (!$this->getIsRecuring() 
     212        if (!$this->getIsRecurring() 
    213213            && ($this->getTries() >= $this->getMaxTries())) 
    214214        { 
  • plugins/sfJobQueuePlugin/trunk/lib/model/sfJobQueue.php

    r6878 r7319  
    22/* 
    33 * This file is part of the sfJobQueuePlugin package. 
    4  *  
     4 * 
    55 * (c) 2007 Xavier Lacot <xavier@lacot.org> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
     
    1010 
    1111/** 
    12  * This plugins enables job queues into Symfony. It includes all the common job  
    13  * queues tasks (start, stop, scheduling through job election strategies, etc.),  
    14  * command line tasks, and a graphical interface for managing queues and jobs.  
    15  * Using a job queue can be useful when asynchronised server-side operations  
    16  * have to be performed (periodically grabbing a RSS feed, automatically sending  
     12 * This plugins enables job queues into Symfony. It includes all the common job 
     13 * queues tasks (start, stop, scheduling through job election strategies, etc.), 
     14 * command line tasks, and a graphical interface for managing queues and jobs. 
     15 * Using a job queue can be useful when asynchronised server-side operations 
     16 * have to be performed (periodically grabbing a RSS feed, automatically sending 
    1717 * emails, etc.) or in environments without a cron access. 
    18  *  
     18 * 
    1919 * @author   Xavier Lacot <xavier@lacot.org> 
    2020 * @see      http://www.symfony-project.com/trac/wiki/sfJobQueuePlugin 
     
    3232  const SUCCESS = 'success'; 
    3333 
    34   public static $status_text = array(self::STOPPED => 'stopped',  
     34  public static $status_text = array(self::STOPPED => 'stopped', 
    3535                                     self::RUNNING => 'running'); 
    3636 
     
    4242  /** 
    4343   * Creates a new job in the queue 
    44    *  
     44   * 
    4545   * @param    string    type of the job 
    4646   * @param    array     options of the job 
    47    *  
     47   * 
    4848   * @return   object    created job 
    4949   */ 
     
    6464  /** 
    6565   * Returns the number of jobs to be done 
    66    *  
     66   * 
    6767   * @return   integer 
    6868   */ 
     
    8181  } 
    8282 
    83   public function getNbActiveRecuringJobs() 
     83  public function getNbActiveRecurringJobs() 
    8484  { 
    8585    $c = new Criteria(); 
    8686    $c->add(sfJobPeer::SF_JOB_QUEUE_ID, $this->getId()); 
    8787    $c->add(sfJobPeer::STATUS, array(sfJob::RUNNING, sfJob::IDLE, sfJob::STOPPED), Criteria::IN); 
    88     $c->add(sfJobPeer::IS_RECURING, 1); 
     88    $c->add(sfJobPeer::IS_RECURRING, 1); 
    8989    return sfJobPeer::doCount($c); 
    9090  } 
     
    106106  /** 
    107107   * Returns the number of cancelled jobs 
    108    *  
     108   * 
    109109   * @return   integer 
    110110   */ 
     
    119119  /** 
    120120   * Returns the number of jobs completed on failure 
    121    *  
     121   * 
    122122   * @return   integer 
    123123   */ 
     
    132132  /** 
    133133   * Returns the number of completed jobs 
    134    *  
     134   * 
    135135   * @return   integer 
    136136   */ 
     
    145145  /** 
    146146   * Returns the number of jobs completed on success 
    147    *  
     147   * 
    148148   * @return   integer 
    149149   */ 
     
    158158  /** 
    159159   * Gets the current status of the queue from the database 
    160    *  
     160   * 
    161161   * @return integer 
    162162   */ 
     
    169169  /** 
    170170   * Returns the status of the queue, as a text 
    171    *  
     171   * 
    172172   * @return   string 
    173173   */ 
     
    192192  /** 
    193193   * Indicates whether the queue is running or not 
    194    *  
     194   * 
    195195   * @return   boolean 
    196196   */ 
     
    232232      } 
    233233 
    234       $this->logger->log(sprintf('Queue "%s" stopped.',  
     234      $this->logger->log(sprintf('Queue "%s" stopped.', 
    235235                                 $this->getName())); 
    236236      $this->setStatus(self::STOPPED); 
     
    239239    catch (Exception $e) 
    240240    { 
    241       $this->logger->log(sprintf('Queue "%s" unexpectidly stopped on error "%s"',  
     241      $this->logger->log(sprintf('Queue "%s" unexpectedly stopped on error "%s"', 
    242242                                 $this->getName(), 
    243243                                 $e->getMessage())); 
  • plugins/sfJobQueuePlugin/trunk/lib/schedulers/sfScheduler.class.php

    r5658 r7319  
    22/* 
    33 * This file is part of the sfJobQueuePlugin package. 
    4  *  
     4 * 
    55 * (c) 2007 Xavier Lacot <xavier@lacot.org> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
     
    2121  { 
    2222    $query = ' 
    23     SELECT *  
     23    SELECT * 
    2424    FROM %s 
    2525    WHERE %s = ? 
     
    3232    $query = sprintf($query, 
    3333                     sfJobPeer::TABLE_NAME, 
    34                      sfJobPeer::SF_JOB_QUEUE_ID,  
     34                     sfJobPeer::SF_JOB_QUEUE_ID, 
    3535                     sfJobPeer::TRIES, 
    3636                     sfJobPeer::MAX_TRIES, 
    37                      sfJobPeer::IS_RECURING, 
     37                     sfJobPeer::IS_RECURRING, 
    3838                     sfJobPeer::COMPLETED_AT, 
    3939                     sfJobPeer::STATUS, 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJob/config/generator.yml

    r7260 r7319  
    1818      filters:             [type, status, sf_job_queue_id] 
    1919      sort:                [created_at, desc] 
    20       display:             [sf_job_queue, =type, =name, _status, _tries, _is_recuring, created_at, scheduled_at, _last_tried_at, completed_at] 
     20      display:             [sf_job_queue, =type, =name, _status, _tries, _is_recurring, created_at, scheduled_at, _last_tried_at, completed_at] 
    2121      object_actions: 
    2222        _edit:             - 
     
    3030      title:               Job edition 
    3131      display: 
    32         "Job informations": [sf_job_queue_id, _type, name, max_tries, is_recuring, retry_delay, scheduled_at] 
     32        "Job informations": [sf_job_queue_id, _type, name, max_tries, is_recurring, retry_delay, scheduled_at] 
    3333        "Job parameters":   [_params] 
    3434        "Job status":       [status, tries, created_at, last_tried_at, completed_at] 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJob/templates/_is_recuring.php

    r5658 r7319  
    1 <?php if ($sf_job->getIsRecuring()): ?> 
     1<?php if ($sf_job->getIsRecurring()): ?> 
    22  <?php echo image_tag('/sf/sf_admin/images/save.png') ?> 
    33<?php else: ?> 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJob/templates/_tries.php

    r5658 r7319  
    1 <?php echo $sf_job->getTries(); ?><?php if (!$sf_job->getIsRecuring()): ?> / <?php echo $sf_job->getMaxTries(); ?><?php endif; ?> 
     1<?php echo $sf_job->getTries(); ?><?php if (!$sf_job->getIsRecurring()): ?> / <?php echo $sf_job->getMaxTries(); ?><?php endif; ?> 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJobQueue/config/generator.yml

    r7260 r7319  
    1212      _nb_active_ready_jobs:         { name: ready, help: number of jobs ready to be executed } 
    1313      _nb_active_waiting_jobs:       { name: waiting, help: number of waiting jobs } 
    14       _nb_active_recuring_jobs:      { name: recuring, help: number of recuring jobs } 
     14      _nb_active_recurring_jobs:      { name: recurring, help: number of recurring jobs } 
    1515      _nb_active_scheduled_jobs:     { name: scheduled, help: number of scheduled jobs } 
    1616      _nb_active_jobs:               { name: scheduled, help: number of active jobs } 
     
    2424      filters:             [status] 
    2525      sort:                [created_at, desc] 
    26       display:             [_name, _is_running, created_at, _nb_active_ready_jobs, _nb_active_waiting_jobs, __nb_active_recuring_jobs, _nb_active_scheduled_jobs, _nb_active_jobs, nb_completed_successful_jobs, _nb_completed_cancelled_jobs, _nb_completed_failure_jobs] 
     26      display:             [_name, _is_running, created_at, _nb_active_ready_jobs, _nb_active_waiting_jobs, __nb_active_recurring_jobs, _nb_active_scheduled_jobs, _nb_active_jobs, nb_completed_successful_jobs, _nb_completed_cancelled_jobs, _nb_completed_failure_jobs] 
    2727      object_actions: 
    2828        _edit:             - 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJobQueue/templates/_list_th_tabular2.php

    r5658 r7319  
    77    <?php echo image_tag(sfConfig::get('sf_admin_web_dir').'/images/help.png', array('align' => 'absmiddle', 'alt' => __('number of waiting jobs'), 'title' => __('number of waiting jobs'))) ?> 
    88  </th> 
    9   <th id="sf_admin_list_th_nb_active_jobs_recuring"> 
    10     <?php echo __('recuring') ?> 
    11     <?php echo image_tag(sfConfig::get('sf_admin_web_dir').'/images/help.png', array('align' => 'absmiddle', 'alt' => __('number of recuring jobs'), 'title' => __('number of recuring jobs'))) ?> 
     9  <th id="sf_admin_list_th_nb_active_jobs_recurring"> 
     10    <?php echo __('recurring') ?> 
     11    <?php echo image_tag(sfConfig::get('sf_admin_web_dir').'/images/help.png', array('align' => 'absmiddle', 'alt' => __('number of recurring jobs'), 'title' => __('number of recurring jobs'))) ?> 
    1212  </th> 
    1313  <th id="sf_admin_list_th_nb_active_jobs_scheduled"> 
  • plugins/sfJobQueuePlugin/trunk/modules/sfJobQueue/templates/_nb_active_recurring_jobs.php

    r5658 r7319  
    1 <?php echo $sf_job_queue->getNbActiveRecuringJobs(); ?> 
     1<?php echo $sf_job_queue->getNbActiveRecurringJobs(); ?> 
  • plugins/sfJobQueuePlugin/trunk/package.xml

    r5658 r7319  
    6868     <dir name="templates"> 
    6969      <file name="_filters.php" role="data" /> 
    70       <file name="_is_recuring.php" role="data" /> 
     70      <file name="_is_recurring.php" role="data" /> 
    7171      <file name="_list_td_actions.php" role="data" /> 
    7272      <file name="_params.php" role="data" /> 
     
    9999      <file name="_nb_active_jobs.php" role="data" /> 
    100100      <file name="_nb_active_ready_jobs.php" role="data" /> 
    101       <file name="_nb_active_recuring_jobs.php" role="data" /> 
     101      <file name="_nb_active_recurring_jobs.php" role="data" /> 
    102102      <file name="_nb_active_scheduled_jobs.php" role="data" /> 
    103103      <file name="_nb_active_waiting_jobs.php" role="data" />