Bolt\Controller\Async\General::getNews PHP Method

getNews() private method

Get the news from Bolt HQ (with caching).
private getNews ( string $hostname ) : array
$hostname string
return array
    private function getNews($hostname)
    {
        // Cached for two hours.
        $news = $this->app['cache']->fetch('dashboardnews');
        if ($news !== false) {
            $this->app['logger.system']->info('Using cached data', ['event' => 'news']);
            return $news;
        }
        // If not cached, get fresh news.
        $news = $this->fetchNews($hostname);
        $this->app['cache']->save('dashboardnews', $news, 7200);
        return $news;
    }