Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Mechanism creates two cache objects #3712

Open
tinoest opened this issue May 8, 2023 · 2 comments
Open

Cache Mechanism creates two cache objects #3712

tinoest opened this issue May 8, 2023 · 2 comments
Labels
Milestone

Comments

@tinoest
Copy link
Contributor

tinoest commented May 8, 2023

When creating the cache instance it first creates a cache object in $this->_cache_obj it then creates a new instance when called statically.

#0  ElkArte\Cache\CacheMethod\Redis->addServers() called at [/var/www/html/sources/ElkArte/Cache/CacheMethod/Redis.php:45]
#1  ElkArte\Cache\CacheMethod\Redis->__construct(Array ([servers] => Array ([0] => 172.19.0.5:6379))) called at [/var/www/html/sources/ElkArte/Cache/Cache.php:118]
#2  ElkArte\Cache\Cache->_init() called at [/var/www/html/sources/ElkArte/Cache/Cache.php:101]
#3  ElkArte\Cache\Cache->enable(1) called at [/var/www/html/sources/ElkArte/Cache/Cache.php:76]
#4  ElkArte\Cache\Cache->__construct(1, redis, Array ([servers] => Array ([0] => 172.19.0.5:6379))) called at [/var/www/html/sources/ElkArte/Cache/Cache.php:174]
#5  ElkArte\Cache\Cache::instance() called at [/var/www/html/sources/Load.php:53]
#6  reloadSettings() called at [/var/www/html/bootstrap.php:311]
#7  Bootstrap->bringUp() called at [/var/www/html/bootstrap.php:93]
#8  Bootstrap->bringUpBasics() called at [/var/www/html/bootstrap.php:69]
#9  Bootstrap->__construct() called at [/var/www/html/index.php:26]
#0  ElkArte\Cache\CacheMethod\Redis->addServers() called at [/var/www/html/sources/ElkArte/Cache/CacheMethod/Redis.php:45]
#1  ElkArte\Cache\CacheMethod\Redis->__construct(Array ([servers] => Array ([0] => 172.19.0.5:6379))) called at [/var/www/html/sources/ElkArte/Cache/Cache.php:118]
#2  ElkArte\Cache\Cache->_init() called at [/var/www/html/sources/ElkArte/Cache/Cache.php:86]
#3  ElkArte\Cache\Cache->__construct(1, redis, Array ([servers] => Array ([0] => 172.19.0.5:6379))) called at [/var/www/html/sources/ElkArte/Cache/Cache.php:174]
#4  ElkArte\Cache\Cache::instance() called at [/var/www/html/sources/Load.php:53]
#5  reloadSettings() called at [/var/www/html/bootstrap.php:311]
#6  Bootstrap->bringUp() called at [/var/www/html/bootstrap.php:93]
#7  Bootstrap->bringUpBasics() called at [/var/www/html/bootstrap.php:69]
#8  Bootstrap->__construct() called at [/var/www/html/index.php:26]
@Spuds Spuds added this to the 2.0 milestone May 10, 2023
@Spuds Spuds added the bug label May 10, 2023
@Spuds
Copy link
Contributor

Spuds commented May 10, 2023

Thanks for the catch ... not sure what to do ATM, need some time to look into why that is occurring.

@Spuds
Copy link
Contributor

Spuds commented Jun 1, 2024

Yeah its been a year ... I did find that a second object was created when you were in the admin panel cache settings. I've fixed that here: 264974e where it checks if a cache is enabled and if so grabs that object to checking (with a new getter in the base cache class)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants