gitlab-org--gitlab-foss/config/initializers
Yorick Peterse 237c8f66e6
Precalculate trending projects
This commit introduces a Sidekiq worker that precalculates the list of
trending projects on a daily basis. The resulting set is stored in a
database table that is then queried by Project.trending.

This setup means that Unicorn workers no longer _may_ have to calculate
the list of trending projects. Furthermore it supports filtering without
any complex caching mechanisms.

The data in the "trending_projects" table is inserted in the same order
as the project ranking. This means that getting the projects in the
correct order is simply a matter of:

    SELECT projects.*
    FROM projects
    INNER JOIN trending_projects ON trending_projects.project_id = projects.id
    ORDER BY trending_projects.id ASC;

Such a query will only take a few milliseconds at most (as measured on
GitLab.com), opposed to a few seconds for the query used for calculating
the project ranks.

The migration in this commit does not require downtime and takes care of
populating an initial list of trending projects.
2016-10-10 12:27:08 +02:00
..
1_settings.rb Precalculate trending projects 2016-10-10 12:27:08 +02:00
2_app.rb Add release tracking for Sentry 2016-02-17 14:05:58 -05:00
4_ci_app.rb Use new runners registration token to register CI runners 2015-12-11 10:39:39 +01:00
5_backend.rb Remove obsolete code 2016-07-22 17:54:04 +02:00
6_validations.rb Add ENV variable to skip repository storages validations 2016-07-25 13:48:40 -04:00
7_redis.rb Initialize Redis pool in single-threaded context 2016-09-30 12:27:43 +02:00
active_record_query_trace.rb Added active_record_query_trace 2015-10-15 12:05:01 +02:00
ar5_batching.rb Add markdown cache columns to the database, but don't use them yet 2016-10-07 02:54:25 +01:00
ar_monkey_patch.rb Revert the revert of Optimistic Locking 2016-08-22 18:43:13 +03:00
ar_speed_up_migration_checking.rb Memoize ActiveRecord::Migrator.migrations in tests 2016-10-06 19:14:57 +01:00
attr_encrypted_no_db_connection.rb Use Module#prepend instead of alias_method_chain 2016-09-30 07:08:25 -03:00
backtrace_silencers.rb init commit 2011-10-09 00:36:38 +03:00
bullet.rb Added Bullet to the Gemfile 2015-10-15 12:05:01 +02:00
carrierwave.rb Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
chronic_duration.rb Enable exceptions on ChronicDuration 2016-06-13 11:03:30 +01:00
connection_fix.rb Update warn message for MySQL fix 2016-09-28 23:48:32 +00:00
cookies_serializer.rb Rails update to 4.2.4 2015-11-25 18:18:44 +02:00
date_time_formats.rb Add two custom Date/Time conversion formats 2016-01-07 20:01:08 -05:00
default_url_options.rb Fix images in emails 2016-06-16 11:47:01 +01:00
devise.rb Update to send changed password notification emails 2016-08-05 19:27:36 +01:00
devise_password_length.rb.example Add instructions for custom password length limits 2014-01-13 10:41:10 +01:00
disable_email_interceptor.rb Revert "Allow to configure smtp and sendmail in gitlab.yml" 2015-05-06 17:39:18 +03:00
doorkeeper.rb Small refactor and syntax fixes. 2016-08-18 16:47:26 -05:00
gitlab_shell_secret_token.rb Load Github::Shell's secret token from file on initialization instead of every request. 2016-10-06 11:22:37 -04:00
gitlab_workhorse_secret.rb Verify JWT messages from gitlab-workhorse 2016-09-05 15:05:31 +02:00
go_get.rb Revert "Revert "Merge branch 'support-go-subpackages' into 'master' "" 2016-03-12 21:05:23 +00:00
gollum.rb Support Wiki with UTF-8 page name 2016-03-16 02:17:07 +09:00
hamlit.rb Restrict hamlit version, remove coffeescript filters. 2016-06-23 15:54:23 -06:00
health_check.rb Update the health_check gem to the latest release 2016-07-11 09:30:47 -07:00
inflections.rb Create table for award emoji 2016-05-06 10:47:11 +02:00
kaminari_config.rb add kaminari config with default and max per_page values 2012-09-03 04:22:49 -07:00
metrics.rb Gitlab::Checks is now instrumented 2016-09-13 11:58:08 +02:00
mime_types.rb No need for this variable. 2016-09-12 14:23:32 -06:00
mysql_ignore_postgresql_options.rb Patch MySQL to ignore PostgreSQL schema options 2016-03-11 15:25:22 -05:00
omniauth.rb Add leading comment space cop 2016-05-31 19:33:46 -03:00
postgresql_limit_fix.rb Use Module#prepend instead of alias_method_chain 2016-09-30 07:08:25 -03:00
postgresql_opclasses_support.rb Disable Rubocop for PostgreSQL patches 2016-03-11 15:25:23 -05:00
premailer.rb Don't remove IDs via premailer 2016-05-25 16:56:06 -04:00
public_key.rb Fix typo. 2015-03-20 16:13:03 -07:00
rack_attack.rb.example Import from Github using Personal Access Tokens. 2016-06-30 18:48:17 +02:00
rack_attack_git_basic_auth.rb Disable Rack Attack if admin disables it in config file 2016-04-27 07:22:02 -07:00
rack_lineprof.rb Rails update to 4.2.4 2015-11-25 18:18:44 +02:00
relative_naming_ci_namespace.rb Improve manual actions code and add model, service and feature tests 2016-07-18 14:46:20 +02:00
relative_url.rb.sample Use dedicated relative_url.rb initializer 2016-02-29 21:17:48 +01:00
request_profiler.rb Fix RequestProfiler::Middleware error when code is reloaded in development 2016-08-01 14:26:11 +02:00
secret_token.rb Ignore Rails/Exit cop in initializer 2016-08-04 10:17:35 +01:00
sentry.rb Don't send Private-Token headers to Sentry 2016-10-04 16:57:01 +02:00
session_store.rb Deduplicated resque.yml loading from several places 2016-08-04 18:55:37 +02:00
sherlock.rb Rails update to 4.2.4 2015-11-25 18:18:44 +02:00
sidekiq.rb Make sidekiq get config settings from Gitlab::RedisConfig 2016-08-04 18:55:37 +02:00
smtp_settings.rb.sample Add SMTP as default delivery method to match gitlab-org/omnibus-gitlab!826 2016-06-24 11:56:52 -07:00
static_files.rb Migrate mailers to ActiveJob 2015-11-26 17:03:43 +02:00
time_zone.rb Add timezone configuration to gitlab.yml 2014-10-21 11:27:16 +02:00
trusted_proxies.rb Ignore invalid IPs in X-Forwarded-For when trusted proxies are configured. 2016-07-31 15:36:11 -04:00
wrap_parameters.rb init commit 2011-10-09 00:36:38 +03:00