Code Duplication    Length = 5-5 lines in 2 locations

apps/federation/lib/BackgroundJob/GetSharedSecret.php 1 location

@@ 159-163 (lines=5) @@
156
157
		// kill job after 30 days of trying
158
		$deadline = $currentTime - $this->maxLifespan;
159
		if ($created < $deadline) {
160
			$this->retainJob = false;
161
			$this->trustedServers->setServerStatus($target,TrustedServers::STATUS_FAILURE);
162
			return;
163
		}
164
165
		$endPoints = $this->ocsDiscoveryService->discover($target, 'FEDERATED_SHARING');
166
		$endPoint = isset($endPoints['shared-secret']) ? $endPoints['shared-secret'] : $this->defaultEndPoint;

apps/federation/lib/BackgroundJob/RequestSharedSecret.php 1 location

@@ 161-165 (lines=5) @@
158
159
		// kill job after 30 days of trying
160
		$deadline = $currentTime - $this->maxLifespan;
161
		if ($created < $deadline) {
162
			$this->retainJob = false;
163
			$this->trustedServers->setServerStatus($target, TrustedServers::STATUS_FAILURE);
164
			return;
165
		}
166
167
		$endPoints = $this->ocsDiscoveryService->discover($target, 'FEDERATED_SHARING');
168
		$endPoint = isset($endPoints['shared-secret']) ? $endPoints['shared-secret'] : $this->defaultEndPoint;