diff --git a/config/packages/cache.yaml b/config/packages/cache.yaml index e3805ad..fd13aaa 100644 --- a/config/packages/cache.yaml +++ b/config/packages/cache.yaml @@ -16,3 +16,7 @@ framework: #my.dedicated.cache: null subscriptions.cache: null credits.cache: null + articles.cache: + adapter: cache.adapter.redis + provider: Redis + default_lifetime: 3600 diff --git a/src/Command/CacheLatestArticlesCommand.php b/src/Command/CacheLatestArticlesCommand.php index 1f18be3..42617e0 100644 --- a/src/Command/CacheLatestArticlesCommand.php +++ b/src/Command/CacheLatestArticlesCommand.php @@ -16,13 +16,12 @@ use Elastica\Collapse; use Elastica\Query\Terms; use Psr\Cache\CacheItemPoolInterface; use swentel\nostr\Key\Key; -use Symfony\Contracts\Cache\CacheInterface; #[AsCommand(name: 'app:cache_latest_articles', description: 'Cache the latest articles list')] class CacheLatestArticlesCommand extends Command { private FinderInterface $finder; - private CacheInterface $appCache; + private CacheItemPoolInterface $articlesCache; private ParameterBagInterface $params; public function __construct(FinderInterface $finder, CacheItemPoolInterface $articlesCache, ParameterBagInterface $params)