Development

Changeset 7340

You must first sign up to be able to contribute.

Changeset 7340

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

sfJobQueuePlugin: recurring jobs management improved - backport of [7339]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfJobQueuePlugin/branches/0.3/data/tasks/sfJobQueueTask.php

    r7315 r7340  
    114114    $job_queue->setRequestedStatus(sfJobQueue::STOPPED); 
    115115    $job_queue->save(); 
    116     pake_echo(sprintf('Queue "%s" stop requeted.', $queue_name)); 
     116    pake_echo(sprintf('Queue "%s" stop requested.', $queue_name)); 
    117117  } 
    118118} 
  • plugins/sfJobQueuePlugin/branches/0.3/lib/model/sfJob.php

    r7319 r7340  
    110110    $this->setTries($this->getTries() + 1); 
    111111    $this->setLastTriedAt(time()); 
     112    $this->setStatus(sfJob::RUNNING); 
    112113    $this->save(); 
    113114 
     
    158159 
    159160      $this->setStatus($status); 
     161    } 
     162    else 
     163    { 
     164      $this->setStatus(sfJob::IDLE); 
    160165    } 
    161166 
  • plugins/sfJobQueuePlugin/branches/0.3/modules/sfJob/templates/_list_td_actions.php

    r7320 r7340  
    11<td> 
    2   <ul class="sf_admin_td_actions"> 
    3     <li><?php echo link_to(image_tag('/sf/sf_admin/images/edit_icon.png', array('alt' => __('edit'), 'title' => __('edit'))), 'sfJob/edit?id='.$sf_job->getId()) ?></li> 
    4     <?php if (!in_array($sf_job->getStatus(), array(sfJob::SUCCESS, sfJob::CANCELLED, sfJob::ERROR))): ?> 
     2  <?php 
     3  if (!in_array($sf_job->getStatus(), array(sfJob::SUCCESS, sfJob::CANCELLED, sfJob::ERROR, sfJob::RUNNING)) 
     4      || ($sf_job->getCompletedAt() === null)): 
     5  ?> 
     6    <ul class="sf_admin_td_actions"> 
     7      <li><?php echo link_to(image_tag('/sf/sf_admin/images/edit_icon.png', array('alt' => __('edit'), 'title' => __('edit'))), 'sfJob/edit?id='.$sf_job->getId()) ?></li> 
    58      <li><?php echo link_to(image_tag('/sf/sf_admin/images/delete.png', array('alt' => __('Cancel job'), 'title' => __('Cancel job'))), 'sfJob/cancel?id='.$sf_job->getId()) ?></li> 
    6     <?php endif; ?
    7     <li><?php echo link_to(image_tag('/sf/sf_admin/images/next.png', array('alt' => __('Run job'), 'title' => __('Run job'), 'onclick' => "return confirm('Please be aware that it may take several minutes until this action will finish. If the job to be run is huge, it may overload your webserver. In this case, you will prefer to run this job using the asynchronous job queue manager.')")), 'sfJob/run?id='.$sf_job->getId()) ?></li
    8   </ul
     9      <li><?php echo link_to(image_tag('/sf/sf_admin/images/next.png', array('alt' => __('Run job'), 'title' => __('Run job'), 'onclick' => "return confirm('Please be aware that it may take several minutes until this action will finish. If the job to be run is huge, it may overload your webserver. In this case, you will prefer to run this job using the asynchronous job queue manager.')")), 'sfJob/run?id='.$sf_job->getId()) ?></li
     10    </ul
     11  <?php endif; ?
    912</td>