mirror of
https://github.com/danog/file.git
synced 2024-11-30 04:19:39 +01:00
Fix stat cache derps
This commit is contained in:
parent
4bda31dd5f
commit
498022983e
@ -24,7 +24,9 @@ class BlockingDriver implements Driver {
|
|||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function stat($path) {
|
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);
|
StatCache::set($path, $stat);
|
||||||
\clearstatcache(true, $path);
|
\clearstatcache(true, $path);
|
||||||
} else {
|
} else {
|
||||||
|
@ -94,6 +94,10 @@ class UvDriver implements Driver {
|
|||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function stat($path) {
|
public function stat($path) {
|
||||||
|
if ($stat = StatCache::get($path)) {
|
||||||
|
return new Success($stat);
|
||||||
|
}
|
||||||
|
|
||||||
$this->reactor->addRef();
|
$this->reactor->addRef();
|
||||||
$promisor = new Deferred;
|
$promisor = new Deferred;
|
||||||
\uv_fs_stat($this->loop, $path, function($fh, $stat) use ($promisor, $path) {
|
\uv_fs_stat($this->loop, $path, function($fh, $stat) use ($promisor, $path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user