gitlab-org--gitlab-foss/app/workers
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
..
repository_check Do not check repos without push events 2016-06-15 19:11:25 +02:00
admin_email_worker.rb Rename almost all the things 2016-04-06 13:47:05 +02:00
build_email_worker.rb Migrate CI WebHooks and Emails to new tables 2015-12-10 16:04:08 +01:00
clear_database_cache_worker.rb Add markdown cache columns to the database, but don't use them yet 2016-10-07 02:54:25 +01:00
delete_user_worker.rb Add ability to delete a user with force 2016-03-15 21:09:25 +01:00
email_receiver_worker.rb An instruction for what to do 2016-06-15 15:49:01 +08:00
emails_on_push_worker.rb Fix force-push message in push emails 2016-08-19 13:07:39 +01:00
expire_build_artifacts_worker.rb ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup 2016-10-07 15:33:58 +02:00
expire_build_instance_artifacts_worker.rb ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup 2016-10-07 15:33:58 +02:00
git_garbage_collect_worker.rb Refresh branch cache after `git gc` 2016-07-13 06:49:58 -07:00
gitlab_shell_worker.rb replace Gitolited mixin with Gitlab::ShellAdapter 2013-03-21 21:01:14 +02:00
group_destroy_worker.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
import_export_project_cleanup_worker.rb using shared path for project import uploads and refactored gitlab remove export worker 2016-08-04 12:51:55 +02:00
irker_worker.rb Use commit deltas when counting files in IrkerWorker 2016-08-03 19:26:10 +02:00
merge_worker.rb API support, incorporated feedback 2015-11-18 11:17:41 +01:00
new_note_worker.rb [WIP] Background process note logic for #3948 2016-01-28 13:04:42 -05:00
post_receive.rb Log base64-decoded PostReceive arguments 2016-08-05 15:00:12 +02:00
process_pipeline_worker.rb Do not return false in commit status transition 2016-10-04 16:34:22 +02:00
project_cache_worker.rb Check if repo exists before attempting to update cache info 2016-03-27 06:17:49 -07:00
project_destroy_worker.rb Fix skip_repo parameter being ignored when destroying a namespace 2016-08-03 17:07:38 -07:00
project_export_worker.rb limit project expor retry to only 3 2016-07-18 09:23:41 +02:00
project_service_worker.rb Fix async services execution broken in 7.6 2014-12-29 17:48:43 +02:00
project_web_hook_worker.rb Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
prune_old_events_worker.rb Optimized event pruning query to avoid two queries. 2016-09-07 12:55:25 -07:00
remove_expired_group_links_worker.rb Allow project group links to be expired 2016-08-18 22:45:41 +01:00
remove_expired_members_worker.rb Create Member.expired scope. 2016-08-09 18:39:13 +02:00
repository_archive_cache_worker.rb Add service to clean up repository archive cache 2016-07-21 10:31:49 -03:00
repository_fork_worker.rb Tracking of custom events 2016-08-17 10:04:04 +02:00
repository_import_worker.rb Does not halt the GitHub import process when an error occurs 2016-08-24 12:16:42 -03:00
requests_profiles_worker.rb Profile requests when a header is passed 2016-07-26 20:06:09 +02:00
stuck_ci_builds_worker.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
system_hook_worker.rb Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
trending_projects_worker.rb Precalculate trending projects 2016-10-10 12:27:08 +02:00
update_pipeline_worker.rb Do not return false in commit status transition 2016-10-04 16:34:22 +02:00