Skip to content

Commit

Permalink
Merge pull request #119 from micschk/patch-2
Browse files Browse the repository at this point in the history
Making inclusion-duration of finished jobs configurable
  • Loading branch information
nyeholt authored Apr 19, 2017
2 parents a4add19 + 5da00e6 commit cccd9fc
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 cccd9fc

Please sign in to comment.