Skip to content

Commit

Permalink
Actually store something in status cache
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Oct 21, 2020
1 parent 8ed01f2 commit 9085f44
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Driver/StatusCachingDriver.php
Expand Up @@ -39,7 +39,14 @@ public function getStatus(string $path): Promise
return new Success($cachedStat);
}

return $this->driver->getStatus($path);
return call(function () use ($path) {
$stat = yield $this->driver->getStatus($path);
if ($stat) {
$this->statusCache->set($path, $stat, 1000);
}

return $stat;
});
}

public function getLinkStatus(string $path): Promise
Expand Down

0 comments on commit 9085f44

Please sign in to comment.