Skip to content

Commit

Permalink
Fix(defaultJobs) update readme and default jobs check to use injector…
Browse files Browse the repository at this point in the history
… correctly
  • Loading branch information
Stephen McMahon committed Jul 19, 2017
1 parent 59f0cb9 commit 35d1ade
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
49 changes: 25 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,30 +172,31 @@ Default jobs are defined in yml config the sample below covers the options and e
```
Injector:
QueuedJobService:
defaultJobs:
# This key is used as the title for error logs and alert emails
ArbitraryName:
# The job type should be the class name of a job REQUIRED
type: 'ScheduledExternalImportJob'
# This plus the job type is used to create the SQL query REQUIRED
filter:
# 1 or more Fieldname: 'value' sets that will be queried on REQUIRED
# These can be valid ORM filter
JobTitle: 'Scheduled import from Services'
# Sets whether the job will be recreated or not OPTIONAL
recreate: 1
# Set the email address to send the alert to if not set site admin email is used OPTIONAL
email: '[email protected]'
# Parameters set on the recreated object OPTIONAL
construct:
# 1 or more Fieldname: 'value' sets be passed to the constructor OPTIONAL
repeat: 300
title: 'Scheduled import from Services'
# Minimal implementation will send alerts but not recreate
AnotherTitle:
type: 'AJob'
filter:
JobTitle: 'A job'
properties:
defaultJobs:
# This key is used as the title for error logs and alert emails
ArbitraryName:
# The job type should be the class name of a job REQUIRED
type: 'ScheduledExternalImportJob'
# This plus the job type is used to create the SQL query REQUIRED
filter:
# 1 or more Fieldname: 'value' sets that will be queried on REQUIRED
# These can be valid ORM filter
JobTitle: 'Scheduled import from Services'
# Sets whether the job will be recreated or not OPTIONAL
recreate: 1
# Set the email address to send the alert to if not set site admin email is used OPTIONAL
email: '[email protected]'
# Parameters set on the recreated object OPTIONAL
construct:
# 1 or more Fieldname: 'value' sets be passed to the constructor OPTIONAL
repeat: 300
title: 'Scheduled import from Services'
# Minimal implementation will send alerts but not recreate
AnotherTitle:
type: 'AJob'
filter:
JobTitle: 'A job'
```
## Configuring the CleanupJob
Expand Down
2 changes: 0 additions & 2 deletions code/services/QueuedJobService.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ public function checkJobHealth($queue = null) {
public function checkdefaultJobs($queue = null) {
$queue = $queue ?: QueuedJob::QUEUED;

$this->defaultJobs = !empty($this->defaultJobs) ? $this->defaultJobs : Config::inst()->get(__CLASS__, 'defaultJobs');

if (count($this->defaultJobs)) {

$activeJobs = QueuedJobDescriptor::get()->filter(array(
Expand Down

0 comments on commit 35d1ade

Please sign in to comment.