Code Duplication    Length = 7-7 lines in 2 locations

code/control/DNRoot.php 1 location

@@ 454-460 (lines=7) @@
451
		$dataArchive->write();
452
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
453
454
		$cleanupFn = function () use ($workingDir, $dataTransfer, $dataArchive) {
455
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
456
			$process->setTimeout(120);
457
			$process->run();
458
			$dataTransfer->delete();
459
			$dataArchive->delete();
460
		};
461
462
		// extract the sspak contents so we can inspect them
463
		try {

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 432-438 (lines=7) @@
429
430
		// Rollback cleanup.
431
		$self = $this;
432
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
433
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
434
			$self->rebuild($environment, $log);
435
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
436
			$process->setTimeout(120);
437
			$process->run();
438
		};
439
440
		// Restore database into target environment
441
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {