Cancelled
Push — stable9 ( a5ea22...66c84e )
by Victor
516:53 queued 516:53
created

Task::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Copyright (c) 2015 Victor Dubiniuk <[email protected]>
4
 * This file is licensed under the Affero General Public License version 3 or
5
 * later.
6
 * See the COPYING-README file.
7
 */
8
9
namespace OCA\Files_Antivirus\Cron;
10
11
use OC\BackgroundJob\TimedJob;
12
use OCA\Files_Antivirus\AppInfo\Application;
13
14
15
class Task extends TimedJob {
16
17
	/**
18
	 * sets the correct interval for this timed job
19
	 */
20
	public function __construct() {
21
		// Run once per 15 minutes
22
		$this->setInterval(60 * 15);
23
	}
24
25
	public static function run() {
26
		if (!\OCP\App::isEnabled('files_antivirus')){
27
			return;
28
		}
29
30
		$application = new Application();
31
		$container = $application->getContainer();
32
		$container->query('BackgroundScanner')->run();
33
	}
34
}
35