Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea62004

Browse files
committedJul 28, 2021
Avoid slow redis query through iterating over KEYS
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 86d27ff commit ea62004

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎lib/private/Files/ObjectStore/ObjectStoreStorage.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,12 @@ private function validateUploadCache(): void {
704704
}
705705
}
706706

707-
private function getUploadCacheKey($urn, $uploadId, $chunkId = null): string {
708-
return $urn . '-' . $uploadId . '-' . ($chunkId ? $chunkId . '-' : '');
707+
private function getUploadCacheKey($urn, $uploadId, $key = null): string {
708+
return $urn . '-' . $uploadId . '-' . ($key ? $key . '-' : '');
709709
}
710710

711711
private function clearCache($urn, $uploadId): void {
712-
$this->uploadCache->clear($this->getUploadCacheKey($urn, $uploadId));
712+
$this->uploadCache->remove($this->getUploadCacheKey($urn, $uploadId, 'uploadId'));
713+
$this->uploadCache->remove($this->getUploadCacheKey($urn, $uploadId, 'parts'));
713714
}
714715
}

0 commit comments

Comments
 (0)
Please sign in to comment.