Skip to content

Commit

Permalink
Making inclusion-duration of finished jobs configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
micschk authored and Nathan Glasl committed Jun 30, 2017
1 parent b0a83fb commit 4262e03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/controllers/QueuedJobsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ class QueuedJobsAdmin extends ModelAdmin {
* @var QueuedJobService
*/
public $jobQueue;

/**
* @config The number of seconds to include jobs that have finished
* default: 300 (5 minutes), examples: 3600(1h), 86400(1d)
*/
private static $max_finished_jobs_age = 300;

/**
* @param int $id
Expand All @@ -57,7 +63,7 @@ class QueuedJobsAdmin extends ModelAdmin {
public function getEditForm($id = null, $fields = null) {
$form = parent::getEditForm($id, $fields);

$filter = $this->jobQueue->getJobListFilter(null, 300);
$filter = $this->jobQueue->getJobListFilter(null, self::config()->max_finished_jobs_age);

$list = DataList::create('QueuedJobDescriptor');
$list = $list->where($filter)->sort('Created', 'DESC');
Expand Down

0 comments on commit 4262e03

Please sign in to comment.