mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
more reliable hasUpdated for s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
7983ded102
commit
4108655a46
1 changed files with 13 additions and 0 deletions
|
|
@ -724,4 +724,17 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
}
|
||||
return $this->versioningEnabled;
|
||||
}
|
||||
|
||||
public function hasUpdated($path, $time) {
|
||||
// for files we can get the proper mtime
|
||||
if ($path !== '' && $object = $this->headObject($path)) {
|
||||
$stat = $this->objectToMetaData($object);
|
||||
return $stat['mtime'] > $time;
|
||||
} else {
|
||||
// for directories, the only real option we have is to do a prefix listing and iterate over all objects
|
||||
// however, since this is just as expensive as just re-scanning the directory, we can simply return true
|
||||
// and have the scanner figure out if anything has actually changed
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue