mirror of
https://github.com/danog/file.git
synced 2024-11-29 20:09:10 +01:00
Fix stat cache derps
This commit is contained in:
parent
4bda31dd5f
commit
498022983e
@ -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 {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user