Skip to content

Commit aa33468

Browse files
committed
feat: 增加删除文件后,has 方法会延迟的说明
1 parent ae510b3 commit aa33468

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Upyun/Upyun.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function read($path, $saveHandler = NULL, $params = array()) {
7575

7676
/**
7777
* 判断文件是否存在
78+
* 注意: 对刚删除的文件, 立即调用该方法可能会返回 true, 因为服务端执行删除操作后可能会有 1-2 秒的延迟.
7879
* @param $path
7980
*
8081
* @return bool

tests/UpyunTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function testHas() {
102102
self::$upyun->write($name, 'test file content 4');
103103
$this->assertEquals(self::$upyun->has($name), true);
104104
self::$upyun->delete($name);
105+
sleep(2);
105106
$this->assertEquals(self::$upyun->has($name), false);
106107
}
107108

0 commit comments

Comments
 (0)