Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Skip previously scheduled jobs if app was disabled #84

Merged
merged 1 commit into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jobs/deletejob.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use OCA\Search_Lucene\Db\Status;
use OCA\Search_Lucene\Db\StatusMapper;
use OCA\Search_Lucene\Lucene\Index;
use OCP\App;

class DeleteJob extends TimedJob {

Expand All @@ -29,6 +30,9 @@ public function __construct() {
* @param array $arguments
*/
public function run($arguments){
if (!App::isEnabled('search_lucene')) {
return;
}

$app = new Application();
$container = $app->getContainer();
Expand Down
5 changes: 5 additions & 0 deletions jobs/indexjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
use OCA\Search_Lucene\AppInfo\Application;
use OCA\Search_Lucene\Core\Logger;
use OC\BackgroundJob\QueuedJob;
use OCP\App;

class IndexJob extends QueuedJob {

/**
* @param array $arguments
*/
public function run($arguments){
if (!App::isEnabled('search_lucene')) {
return;
}

$app = new Application();
$container = $app->getContainer();

Expand Down
5 changes: 5 additions & 0 deletions jobs/optimizejob.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OCA\Search_Lucene\AppInfo\Application;
use OCA\Search_Lucene\Core\Logger;
use OC\BackgroundJob\TimedJob;
use OCP\App;

class OptimizeJob extends TimedJob {

Expand All @@ -25,6 +26,10 @@ public function __construct() {
* @param array $arguments
*/
public function run($arguments){
if (!App::isEnabled('search_lucene')) {
return;
}

$app = new Application();
$container = $app->getContainer();
/** @var Logger $logger */
Expand Down