Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add check for empty result in storage memcache
  • Loading branch information
Vincent Petry committed Aug 1, 2017
commit 8e7ed3a458eaa110ad9d38deb17e4e8b53397184
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static function getStorageById($storageId) {
self::$localCache = new CappedMemoryCache();
}
$result = self::$localCache->get($storageId);
if ($result === null) {
if ($result === null || empty($result) || !isset($result['numeric_id'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the empty($result)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed now 7dca926

$result = self::getStorageByIdFromCache($storageId);
self::$localCache->set($storageId, $result);
}
Expand All @@ -134,7 +134,7 @@ private static function getDistributedCache() {
*/
private static function getStorageByIdFromCache($storageId) {
$result = self::getDistributedCache()->get($storageId);
if ($result === null) {
if ($result === null || empty($result) || !isset($result['numeric_id'])) {
$result = self::getStorageByIdFromDb($storageId);
self::getDistributedCache()->set(
$storageId, $result, self::$distributedCacheTTL
Expand Down