Code Duplication    Length = 13-13 lines in 2 locations

code/jobs/DataTransferJob.php 1 location

@@ 60-72 (lines=13) @@
57
				))
58
				->exclude('ID', $dataTransfer->ID);
59
60
			if($runningTransfers->count()) {
61
				$runningTransfer = $runningTransfers->first();
62
				$log->write(sprintf(
63
					'[-] Error: another transfer is in progress (started at %s by %s)',
64
					$runningTransfer->dbObject('Created')->Nice(),
65
					$runningTransfer->Author()->Title
66
				));
67
				throw new RuntimeException(sprintf(
68
					'Another transfer is in progress (started at %s by %s)',
69
					$runningTransfer->dbObject('Created')->Nice(),
70
					$runningTransfer->Author()->Title
71
				));
72
			}
73
74
75
			// before we push data to an environment, we'll make a backup first

code/jobs/DeployJob.php 1 location

@@ 39-51 (lines=13) @@
36
			// Disallow concurrent deployments (don't rely on queuing implementation to restrict this)
37
			// Only consider deployments started in the last 30 minutes (older jobs probably got stuck)
38
			$runningDeployments = $environment->runningDeployments()->exclude('ID', $this->args['deploymentID']);
39
			if($runningDeployments->count()) {
40
				$runningDeployment = $runningDeployments->first();
41
				$log->write(sprintf(
42
					'[-] Error: another deployment is in progress (started at %s by %s)',
43
					$runningDeployment->dbObject('Created')->Nice(),
44
					$runningDeployment->Deployer()->Title
45
				));
46
				throw new RuntimeException(sprintf(
47
					'Another deployment is in progress (started at %s by %s)',
48
					$runningDeployment->dbObject('Created')->Nice(),
49
					$runningDeployment->Deployer()->Title
50
				));
51
			}
52
53
			$environment->Backend()->deploy(
54
				$environment,