From d94e65303039fab231a5b02704d76af984edb970 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 3 Oct 2020 06:10:39 +0000 Subject: [PATCH] Issue 9344: Update trending tags hourly --- src/Model/Tag.php | 4 ++-- src/Worker/Cron.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Tag.php b/src/Model/Tag.php index 7e99ae1a3a..f947b9f898 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -526,7 +526,7 @@ class Tag if (DBA::isResult($tagsStmt)) { $tags = DBA::toArray($tagsStmt); - DI::cache()->set('global_trending_tags-' . $period . '-' . $limit, $tags, Duration::HOUR); + DI::cache()->set('global_trending_tags-' . $period . '-' . $limit, $tags, Duration::DAY); return $tags; } @@ -569,7 +569,7 @@ class Tag if (DBA::isResult($tagsStmt)) { $tags = DBA::toArray($tagsStmt); - DI::cache()->set('local_trending_tags-' . $period . '-' . $limit, $tags, Duration::HOUR); + DI::cache()->set('local_trending_tags-' . $period . '-' . $limit, $tags, Duration::DAY); return $tags; } diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index 43a18ceafc..8ede97c2e4 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -75,13 +75,13 @@ class Cron // Repair entries in the database Worker::add(PRIORITY_LOW, 'RepairDatabase'); - // Update trending tags cache for the community page - Tag::setLocalTrendingHashtags(24, 20); - Tag::setGlobalTrendingHashtags(24, 20); - // Hourly cron calls if (DI::config()->get('system', 'last_cron_hourly', 0) + 3600 < time()) { + // Update trending tags cache for the community page + Tag::setLocalTrendingHashtags(24, 20); + Tag::setGlobalTrendingHashtags(24, 20); + // Search for new contacts in the directory if (DI::config()->get('system', 'synchronize_directory')) { Worker::add(PRIORITY_LOW, 'PullDirectory');