-
Notifications
You must be signed in to change notification settings - Fork 69
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
Unable to select which REDIS configuration is used #72
Comments
I should note this is necessary because of the inability to use the lada-cache:clear command in a Cluster, which is now also the default configuration in Laravel. See #62 |
By default lada-cache should use the 'cache' configuration for REDIS. but adding an option to define that would be better. Currently it doesn't define a connection, so uses 'default'
Another workaround is so to set REDIS_DB to the value of REDIS_CACHE_DB, this encounters the same problem with the cache clear command of course. |
Thanks for reporting, will have a look at this ASAP. However, please note that Lada Cache is not built on top of the Laravel Cache, but directly on top of Laravel Redis. Therefore, the |
Indeed, that is workaround I'm using. And because Lada Cache is built directly on top of Laravel Redis, it's using the 'default' configuration from /app/config/database.php but because it's a cache and not a semi-persistent storage I feel it should either: A. be using the 'cache' configuration for Redis from /app/config/database.php (nothing to do with Laravel Cache - just so happens that Laravel Cache's Redis configuration uses the 'cache' configuration as defined in /app/config/cache.php) - this means that a B. allow the ability to tell Lada Cache which Redis configuration to use and fix the ability to actually flush the Lada Cache Ideally both. with the 'cache' configuration being the default, but allow changing it via Lada Cache's own configuration, and also fix the ability to flush the Lada Cache (pretty much just need a way to tell Lada to FLUSHALL on the Redis 'database' that is configured for it, as it can't do KEYS on a cluster) e.g.: /app/config/database.php
/app/config/lada-cache.php configured to match /app/config/database.php as above: Hope that helps in any way! And thanks for your hard work :) |
Note that since Laravel 5.7
php artisan cache:clear
will not clear the default REDIS connection that lada-cache is configured to use (and doesn't appear to have any way to change)This means that currently lada-cache is using the 'database' configuration of REDIS in Laravel (called 'default') (for things like sessions) and not the 'cache' configuration (called 'cache') .
The only work around I can see at the moment, is to change the redis cache configuration in Laravel (/app/config/cache.php) to have it's connection set to the 'default' and not 'cache'.
This of course undoes the reason it was changed in the first place, doing
php artisan cache:clear
will also delete anything placed in the REDIS 'database' configuration (i.e. sessions and the like)The text was updated successfully, but these errors were encountered: