Issue 9344: Update trending tags hourly

2022.09-rc
Michael 2020-10-03 06:10:39 +00:00
rodzic 78121afcb0
commit d94e653030
2 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -526,7 +526,7 @@ class Tag
if (DBA::isResult($tagsStmt)) { if (DBA::isResult($tagsStmt)) {
$tags = DBA::toArray($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; return $tags;
} }
@ -569,7 +569,7 @@ class Tag
if (DBA::isResult($tagsStmt)) { if (DBA::isResult($tagsStmt)) {
$tags = DBA::toArray($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; return $tags;
} }

Wyświetl plik

@ -75,13 +75,13 @@ class Cron
// Repair entries in the database // Repair entries in the database
Worker::add(PRIORITY_LOW, 'RepairDatabase'); Worker::add(PRIORITY_LOW, 'RepairDatabase');
// Hourly cron calls
if (DI::config()->get('system', 'last_cron_hourly', 0) + 3600 < time()) {
// Update trending tags cache for the community page // Update trending tags cache for the community page
Tag::setLocalTrendingHashtags(24, 20); Tag::setLocalTrendingHashtags(24, 20);
Tag::setGlobalTrendingHashtags(24, 20); Tag::setGlobalTrendingHashtags(24, 20);
// Hourly cron calls
if (DI::config()->get('system', 'last_cron_hourly', 0) + 3600 < time()) {
// Search for new contacts in the directory // Search for new contacts in the directory
if (DI::config()->get('system', 'synchronize_directory')) { if (DI::config()->get('system', 'synchronize_directory')) {
Worker::add(PRIORITY_LOW, 'PullDirectory'); Worker::add(PRIORITY_LOW, 'PullDirectory');