-
I found out Memcached is not storing some structure I wanted. I discovered that set() function fails, responding with false. Later I discovered reason using Memcached::getResultCode() which I found in phpDoc.
-
This response, however is not handled in Nette. I suggest failure on write to cache should at least trigger notice for user.
I will gladly make a PR, but before I would like to know author's opinion.
Instead of
|
$this->memcached->set($key, $meta, $expire); |
I would suggest something like:
$stored = $this->memcached->set($key, $meta, $expire);
if(!$stored){
trigger_error("Storing to memcached failed with error ".$this->memcached->getResultCode().": " . $this->memcached->getResultMessage(), E_USER_NOTICE);
}
⚠️ Adding new Notice might consider that as a Breaking Change - Im not completely familiar with these internal rules.
I found out Memcached is not storing some structure I wanted. I discovered that
set()function fails, responding with false. Later I discovered reason usingMemcached::getResultCode()which I found in phpDoc.This response, however is not handled in Nette. I suggest failure on write to cache should at least trigger notice for user.
I will gladly make a PR, but before I would like to know author's opinion.
Instead of
caching/src/Caching/Storages/MemcachedStorage.php
Line 169 in ceb814d
I would suggest something like: