From 498022983e260d80a568c32b13b76c8a25460a41 Mon Sep 17 00:00:00 2001 From: Daniel Lowrey Date: Sat, 29 Aug 2015 07:34:18 -0400 Subject: [PATCH] Fix stat cache derps --- lib/BlockingDriver.php | 4 +++- lib/UvDriver.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/BlockingDriver.php b/lib/BlockingDriver.php index 2aa7fc4..7fcde5c 100644 --- a/lib/BlockingDriver.php +++ b/lib/BlockingDriver.php @@ -24,7 +24,9 @@ class BlockingDriver implements Driver { * {@inheritdoc} */ public function stat($path) { - if ($stat = @\stat($path)) { + if ($stat = StatCache::get($path)) { + return new Success($stat); + } elseif ($stat = @\stat($path)) { StatCache::set($path, $stat); \clearstatcache(true, $path); } else { diff --git a/lib/UvDriver.php b/lib/UvDriver.php index 5f8b4ab..c3252cb 100644 --- a/lib/UvDriver.php +++ b/lib/UvDriver.php @@ -94,6 +94,10 @@ class UvDriver implements Driver { * {@inheritdoc} */ public function stat($path) { + if ($stat = StatCache::get($path)) { + return new Success($stat); + } + $this->reactor->addRef(); $promisor = new Deferred; \uv_fs_stat($this->loop, $path, function($fh, $stat) use ($promisor, $path) {