Skip to content

Commit

Permalink
Deployer: added caching for local paths if use multiple batches (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiViN authored and dg committed Oct 22, 2019
1 parent 2700128 commit f1055ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Deployment/Deployer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public function deploy(): void
}

$this->logger->log("Scanning files in $this->localDir");
$localPaths = $this->collectPaths();
static $cache;
$localPaths = &$cache[serialize([$this->localDir, $this->ignoreMasks, $this->includeMasks, $this->filters, $this->preprocessMasks])];
if ($localPaths === null) {
$localPaths = $this->collectPaths();
}

unset($localPaths["/$this->deploymentFile"], $remotePaths["/$this->deploymentFile"]);
$toDelete = $this->allowDelete ? array_keys(array_diff_key($remotePaths, $localPaths)) : [];
Expand Down

0 comments on commit f1055ae

Please sign in to comment.