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

Task   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 20
ccs 0
cts 11
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 9 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