You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.
Error:
app/cache/dev/appDevDebugProjectContainer.php - Linea: 880 - Redis server went away
I am using this bundle and what happens to me is that when the doctrine server is down the application stops working throwing me a 500 error. The idea would be that if the redis server is down, continue the program reading from the database, but this is not so because it gives me the error reported from the symfony log.
I currently have it injected as follows:
Global.utils:
Class: \ Common \ Utils
arguments: ["@ doctrine_cache.providers.redis"]
And I use the following functions to verify the existence of cache and to save in it:
Public function checkSiExistEnCache ($ key)
{
try {
$ redisCache-> setNamespace ('space-cache');
return $redisCache->fetch($key);
} catch (\Exception $e) {
//@todo logger
$this->logger->crit("Redis is down!!! on check");
return false;
}
}
Public function saveEnCache ($ key, $ data, $ ttl)
{
try {
$ redisCache-> setNamespace ('scrutiny-cache');
$ redisCache-> save ($ key, $ data, $ ttl);
}
catch (\Exception $e) {
//@todo logger
$this->logger->crit("Redis is down!!! on save");
return false;
}
I can not capture the exeption.
Now if instead of placing it in the service container services.YML
I get it through:
Public function saveEnCache ($ key, $ data, $ ttl)
{
try {
$ redisCache = $ this-> container-> get ("doctrine_cache.providers.redis");
$ redisCache-> setNamespace ('space-cache');
return $ redisCache-> fetch ($ key);
} catch (\Exception $e) {
//@todo logger
$this->logger->crit("Redis is down!!! on save");
return false;
}
}
I can capture the exeption!!!
Here if I can capture the exeption and return true or false and continue reading the database if redis would be dropped.
What I would like to know is if this would be affecting the performance of the program, since every time I check the existence of cache, I am instantiating the bundle of redis and perhaps creating too many connections.
With the same bundle but using memcache I did not have this problem.
thanks and regards
Luke!
The text was updated successfully, but these errors were encountered:
I assume #113 would work with that - there's just some disagreement over whether it's a useful feature or not. I'll see if we can come to a conclusion there or if it's something that should be solved directly in the cache library.
In the meantime, if you still have the original problem, could you please confirm if #113 fixes your issue?
Dear, sorry for the delay, the truth passed to me. In my experience, it is useful to be able to know the status of cache service in an integrated way in the library since it would allow this library to be injected correctly and to capture the exeption we could make the necessary decision.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Error:
app/cache/dev/appDevDebugProjectContainer.php - Linea: 880 - Redis server went away
I am using this bundle and what happens to me is that when the doctrine server is down the application stops working throwing me a 500 error. The idea would be that if the redis server is down, continue the program reading from the database, but this is not so because it gives me the error reported from the symfony log.
I currently have it injected as follows:
And I use the following functions to verify the existence of cache and to save in it:
I can not capture the exeption.
Now if instead of placing it in the service container services.YML
I get it through:
public function chequearSiExisteEnCache($key)
{
I can capture the exeption!!!
Here if I can capture the exeption and return true or false and continue reading the database if redis would be dropped.
What I would like to know is if this would be affecting the performance of the program, since every time I check the existence of cache, I am instantiating the bundle of redis and perhaps creating too many connections.
With the same bundle but using memcache I did not have this problem.
thanks and regards
Luke!
The text was updated successfully, but these errors were encountered: