Merge pull request #10591 from nextcloud/smb-stat-retry-13
[13] retry smb stat on timeout
This commit is contained in:
commit
3940790e79
|
@ -40,6 +40,7 @@ use Icewind\SMB\Exception\Exception;
|
|||
use Icewind\SMB\Exception\ForbiddenException;
|
||||
use Icewind\SMB\Exception\InvalidArgumentException;
|
||||
use Icewind\SMB\Exception\NotFoundException;
|
||||
use Icewind\SMB\Exception\TimedOutException;
|
||||
use Icewind\SMB\IFileInfo;
|
||||
use Icewind\SMB\NativeServer;
|
||||
use Icewind\SMB\Server;
|
||||
|
@ -235,13 +236,19 @@ class SMB extends Common implements INotifyStorage {
|
|||
return $result;
|
||||
}
|
||||
|
||||
public function stat($path) {
|
||||
public function stat($path, $retry = true) {
|
||||
try {
|
||||
$result = $this->formatInfo($this->getFileInfo($path));
|
||||
} catch (ForbiddenException $e) {
|
||||
return false;
|
||||
} catch (NotFoundException $e) {
|
||||
return false;
|
||||
} catch (TimedOutException $e) {
|
||||
if ($retry) {
|
||||
return $this->stat($path, false);
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
if ($this->remoteIsShare() && $this->isRootDir($path)) {
|
||||
$result['mtime'] = $this->shareMTime();
|
||||
|
|
Loading…
Reference in New Issue