@@ -38,82 +38,82 @@ |
||
38 | 38 | */ |
39 | 39 | class BackgroundRepair extends TimedJob { |
40 | 40 | |
41 | - /** @var IJobList */ |
|
42 | - private $jobList; |
|
41 | + /** @var IJobList */ |
|
42 | + private $jobList; |
|
43 | 43 | |
44 | - /** @var ILogger */ |
|
45 | - private $logger; |
|
44 | + /** @var ILogger */ |
|
45 | + private $logger; |
|
46 | 46 | |
47 | - /** @var EventDispatcherInterface */ |
|
48 | - private $dispatcher; |
|
47 | + /** @var EventDispatcherInterface */ |
|
48 | + private $dispatcher; |
|
49 | 49 | |
50 | - public function __construct(EventDispatcherInterface $dispatcher) { |
|
51 | - $this->dispatcher = $dispatcher; |
|
52 | - } |
|
50 | + public function __construct(EventDispatcherInterface $dispatcher) { |
|
51 | + $this->dispatcher = $dispatcher; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * run the job, then remove it from the job list |
|
56 | - * |
|
57 | - * @param JobList $jobList |
|
58 | - * @param ILogger|null $logger |
|
59 | - */ |
|
60 | - public function execute($jobList, ILogger $logger = null) { |
|
61 | - // add an interval of 15 mins |
|
62 | - $this->setInterval(15*60); |
|
54 | + /** |
|
55 | + * run the job, then remove it from the job list |
|
56 | + * |
|
57 | + * @param JobList $jobList |
|
58 | + * @param ILogger|null $logger |
|
59 | + */ |
|
60 | + public function execute($jobList, ILogger $logger = null) { |
|
61 | + // add an interval of 15 mins |
|
62 | + $this->setInterval(15*60); |
|
63 | 63 | |
64 | - $this->jobList = $jobList; |
|
65 | - $this->logger = $logger; |
|
66 | - parent::execute($jobList, $logger); |
|
67 | - } |
|
64 | + $this->jobList = $jobList; |
|
65 | + $this->logger = $logger; |
|
66 | + parent::execute($jobList, $logger); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * @param array $argument |
|
71 | - * @throws \Exception |
|
72 | - * @throws \OC\NeedsUpdateException |
|
73 | - */ |
|
74 | - protected function run($argument) { |
|
75 | - if (!isset($argument['app']) || !isset($argument['step'])) { |
|
76 | - // remove the job - we can never execute it |
|
77 | - $this->jobList->remove($this, $this->argument); |
|
78 | - return; |
|
79 | - } |
|
80 | - $app = $argument['app']; |
|
69 | + /** |
|
70 | + * @param array $argument |
|
71 | + * @throws \Exception |
|
72 | + * @throws \OC\NeedsUpdateException |
|
73 | + */ |
|
74 | + protected function run($argument) { |
|
75 | + if (!isset($argument['app']) || !isset($argument['step'])) { |
|
76 | + // remove the job - we can never execute it |
|
77 | + $this->jobList->remove($this, $this->argument); |
|
78 | + return; |
|
79 | + } |
|
80 | + $app = $argument['app']; |
|
81 | 81 | |
82 | - try { |
|
83 | - $this->loadApp($app); |
|
84 | - } catch (NeedsUpdateException $ex) { |
|
85 | - // as long as the app is not yet done with it's offline migration |
|
86 | - // we better not start with the live migration |
|
87 | - return; |
|
88 | - } |
|
82 | + try { |
|
83 | + $this->loadApp($app); |
|
84 | + } catch (NeedsUpdateException $ex) { |
|
85 | + // as long as the app is not yet done with it's offline migration |
|
86 | + // we better not start with the live migration |
|
87 | + return; |
|
88 | + } |
|
89 | 89 | |
90 | - $step = $argument['step']; |
|
91 | - $repair = new Repair([], $this->dispatcher); |
|
92 | - try { |
|
93 | - $repair->addStep($step); |
|
94 | - } catch (\Exception $ex) { |
|
95 | - $this->logger->logException($ex,[ |
|
96 | - 'app' => 'migration' |
|
97 | - ]); |
|
90 | + $step = $argument['step']; |
|
91 | + $repair = new Repair([], $this->dispatcher); |
|
92 | + try { |
|
93 | + $repair->addStep($step); |
|
94 | + } catch (\Exception $ex) { |
|
95 | + $this->logger->logException($ex,[ |
|
96 | + 'app' => 'migration' |
|
97 | + ]); |
|
98 | 98 | |
99 | - // remove the job - we can never execute it |
|
100 | - $this->jobList->remove($this, $this->argument); |
|
101 | - return; |
|
102 | - } |
|
99 | + // remove the job - we can never execute it |
|
100 | + $this->jobList->remove($this, $this->argument); |
|
101 | + return; |
|
102 | + } |
|
103 | 103 | |
104 | - // execute the repair step |
|
105 | - $repair->run(); |
|
104 | + // execute the repair step |
|
105 | + $repair->run(); |
|
106 | 106 | |
107 | - // remove the job once executed successfully |
|
108 | - $this->jobList->remove($this, $this->argument); |
|
109 | - } |
|
107 | + // remove the job once executed successfully |
|
108 | + $this->jobList->remove($this, $this->argument); |
|
109 | + } |
|
110 | 110 | |
111 | - /** |
|
112 | - * @codeCoverageIgnore |
|
113 | - * @param $app |
|
114 | - * @throws NeedsUpdateException |
|
115 | - */ |
|
116 | - protected function loadApp($app) { |
|
117 | - OC_App::loadApp($app); |
|
118 | - } |
|
111 | + /** |
|
112 | + * @codeCoverageIgnore |
|
113 | + * @param $app |
|
114 | + * @throws NeedsUpdateException |
|
115 | + */ |
|
116 | + protected function loadApp($app) { |
|
117 | + OC_App::loadApp($app); |
|
118 | + } |
|
119 | 119 | } |