Code Duplication    Length = 7-7 lines in 2 locations

code/control/DNRoot.php 1 location

@@ 472-478 (lines=7) @@
469
		$dataArchive->write();
470
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
471
472
		$cleanupFn = function() use($workingDir, $dataTransfer, $dataArchive) {
473
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
474
			$process->setTimeout(120);
475
			$process->run();
476
			$dataTransfer->delete();
477
			$dataArchive->delete();
478
		};
479
480
		// extract the sspak contents so we can inspect them
481
		try {

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 392-398 (lines=7) @@
389
390
		// Rollback cleanup.
391
		$self = $this;
392
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
393
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
394
			$self->rebuild($environment, $log);
395
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
396
			$process->setTimeout(120);
397
			$process->run();
398
		};
399
400
		// Restore database into target environment
401
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {