Compare commits

...

1 commit

Author SHA1 Message Date
Julius Härtl
56d60ae7d9
Remove cache entry if file no longer exists on the underlying storage
When a file is removed from the filesystem and still present in the file cache we should
remove it from the file cache once it gets requested for download. Otherwise the sync client
would try rerequesting the file and show sync errors until the filecache becomes aware of
the delete.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-01-29 11:16:25 +01:00

View file

@ -409,6 +409,10 @@ class File extends Node implements IFile {
//throw exception if encryption is disabled but files are still encrypted
try {
if (!$this->info->isReadable()) {
if (!$this->fileView->file_exists(ltrim($this->path, '/'))) {
// the file was present in the file cache but doesn't exist on the storage
$this->fileView->unlink(ltrim($this->path, '/'));
}
// do a if the file did not exist
throw new NotFound();
}