summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-10-11 10:58:50 +0000
committerRobert Speicher <robert@gitlab.com>2016-10-11 10:58:50 +0000
commitcb4c596058765f74c7699294297833fc6b3f94a7 (patch)
tree8d752f2e7a179c2059289f5ffed7a67fadc397aa /config
parent157568f3fd6383a1e3490123664b3f7e4d535976 (diff)
parent237c8f66e6608420629503280aaea555ee980022 (diff)
downloadgitlab-ce-cb4c596058765f74c7699294297833fc6b3f94a7.tar.gz
Merge branch 'precalculate-trending-projects' into 'master'
Precalculate trending projects ## What does this MR do? This MR changes the trending projects code so that data is precalculated, removing the need for any complex caching mechanisms. ## Why was this MR needed? Caching of trending data didn't work properly, still leading to queries. Using caching in general would be very hard due to users being able to apply custom filters to the list of trending projects. See merge request !6749
Diffstat (limited to 'config')
-rw-r--r--config/initializers/1_settings.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index c5ed2162c92..efe0ac9c965 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -304,6 +304,10 @@ Settings.cron_jobs['prune_old_events_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['prune_old_events_worker']['cron'] ||= '* */6 * * *'
Settings.cron_jobs['prune_old_events_worker']['job_class'] = 'PruneOldEventsWorker'
+Settings.cron_jobs['trending_projects_worker'] ||= Settingslogic.new({})
+Settings.cron_jobs['trending_projects_worker']['cron'] = '0 1 * * *'
+Settings.cron_jobs['trending_projects_worker']['job_class'] = 'TrendingProjectsWorker'
+
#
# GitLab Shell
#