fix(config): keep the category cache in the memory cache when available
A cache belongs in Nextcloud's memory cache rather than in the app config. Use the distributed cache (e.g. Redis) with a one-week TTL when one is available; Nextcloud falls back to the local cache (APCu) when only that is configured. Without any memory cache the lazy app config value stays as the fallback. A leftover app config value is removed when the categories are stored in the memory cache, and saving the settings clears both.
This commit is contained in:
@@ -21,6 +21,7 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
use OCP\AppFramework\Utility\ITimeFactory;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IAppConfig;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\IConfig;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\IRequest;
|
||||
@@ -62,7 +63,8 @@ class Application extends App implements IBootstrap
|
||||
$c->get(IUserSession::class),
|
||||
$c->get(IAppConfig::class),
|
||||
$c->get(ITimeFactory::class),
|
||||
$c->get(LangRepository::class)
|
||||
$c->get(LangRepository::class),
|
||||
$c->get(ICacheFactory::class)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user