-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from magento-commerce/develop
MCLOUD-9560: October cloud tools release
- Loading branch information
Showing
17 changed files
with
156 additions
and
185 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
patches/MCLOUD-7845__fix_local_flushing_L2_cache__2.4.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
diff -Nuar a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php | ||
index d0c05613..96f7ad84 100644 | ||
--- a/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php | ||
+++ b/vendor/magento/framework/Cache/Backend/RemoteSynchronizedCache.php | ||
@@ -248,9 +248,23 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache | ||
$this->unlock($id); | ||
} | ||
|
||
+ if (!mt_rand(0, 100) && $this->checkIfLocalCacheSpaceExceeded()) { | ||
+ $this->local->clean(); | ||
+ } | ||
+ | ||
return $this->local->save($dataToSave, $id, [], $specificLifetime); | ||
} | ||
|
||
+ /** | ||
+ * Check if local cache space bigger that configure amount | ||
+ * | ||
+ * @return bool | ||
+ */ | ||
+ private function checkIfLocalCacheSpaceExceeded() | ||
+ { | ||
+ return $this->getFillingPercentage() >= 95; | ||
+ } | ||
+ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
@@ -266,7 +280,8 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache | ||
*/ | ||
public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = []) | ||
{ | ||
- return $this->remote->clean($mode, $tags); | ||
+ return $this->remote->clean($mode, $tags) && | ||
+ $this->local->clean($mode, $tags); | ||
} | ||
|
||
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.