summaryrefslogtreecommitdiff
path: root/app/workers/project_cache_worker.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42GitLab Bot2021-08-191-0/+2
|
* Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42GitLab Bot2021-05-191-1/+3
|
* Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42GitLab Bot2020-12-171-1/+2
|
* Add latest changes from gitlab-org/gitlab@13-1-stable-eeGitLab Bot2020-06-181-2/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-021-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-191-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-301-0/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-181-0/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-131-1/+2
|
* Expire project caches once per push instead of once per refStan Hu2019-08-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | Previously `ProjectCacheWorker` would be scheduled once per ref, which would generate unnecessary I/O and load on Sidekiq, especially if many tags or branches were pushed at once. `ProjectCacheWorker` would expire three items: 1. Repository size: This only needs to be updated once per push. 2. Commit count: This only needs to be updated if the default branch is updated. 3. Project method caches: This only needs to be updated if the default branch changes, but only if certain files change (e.g. README, CHANGELOG, etc.). Because the third item requires looking at the actual changes in the commit deltas, we schedule one `ProjectCacheWorker` to handle the first two cases, and schedule a separate `ProjectCacheWorker` for the third case if it is needed. As a result, this brings down the number of `ProjectCacheWorker` jobs from N to 2. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52046
* Add wiki size to project statisticsPeter Marko2019-05-291-1/+3
|
* Refactor: extract duplicate steps to a service classHiroyuki Sato2019-04-051-3/+2
|
* Update the project statistics immediatellyHiroyuki Sato2019-04-051-0/+7
|
* Refactor project_cache_worker_keyHiroyuki Sato2019-04-051-1/+1
|
* Fix the bug that the project statistics is not updatedHiroyuki Sato2019-04-051-6/+8
|
* Refresh commit count after repository head changesKamil Trzciński2019-03-221-0/+1
|
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-111-0/+2
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Revert "Merge branch ↵Sean McGivern2018-07-041-17/+16
| | | | | '44726-cancel_lease_upon_completion_in_project_cache_worker' into 'master'" This reverts merge request !20103
* Cancel ExclusiveLease upon completion in ProjectCacheWorkerImre Farkas2018-06-301-16/+17
|
* Enable frozen string literals for app/workers/*.rbgfyoung2018-06-271-0/+2
|
* Close low level rugged repository in project cache workerBastian Blank2018-02-061-0/+2
| | | | Signed-off-by: Bastian Blank <waldi@debian.org>
* Add ApplicationWorker and make every worker include itDouwe Maan2017-12-051-2/+1
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-3/+3
|
* Add more storage statisticsMarkus Koller2016-12-211-11/+12
| | | | | | | | | | | | | This adds counters for build artifacts and LFS objects, and moves the preexisting repository_size and commit_count from the projects table into a new project_statistics table. The counters are displayed in the administration area for projects and groups, and also available through the API for admins (on */all) and normal users (on */owned) The statistics are updated through ProjectCacheWorker, which can now do more granular updates with the new :statistics argument.
* Refactor cache refreshing/expiringYorick Peterse2016-11-211-35/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactors repository caching so it's possible to selectively refresh certain caches, instead of just expiring and refreshing everything. To allow this the various methods that were cached (e.g. "tag_count" and "readme") use a similar pattern that makes expiring and refreshing their data much easier. In this new setup caches are refreshed as follows: 1. After a commit (but before running ProjectCacheWorker) we expire some basic caches such as the commit count and repository size. 2. ProjectCacheWorker will recalculate the commit count, repository size, then refresh a specific set of caches based on the list of files changed in a push payload. This requires a bunch of changes to the various methods that may be cached. For one, data should not be cached if a branch used or the entire repository does not exist. To prevent all these methods from handling this manually this is taken care of in Repository#cache_method_output. Some methods still manually check for the existence of a repository but this result is also cached. With selective flushing implemented ProjectCacheWorker no longer uses an exclusive lease for all of its work. Instead this worker only uses a lease to limit the number of times the repository size is updated as this is a fairly expensive operation.
* Don't schedule ProjectCacheWorker unless neededproject-cache-worker-schedulingYorick Peterse2016-10-251-3/+13
| | | | | | This changes ProjectCacheWorker.perform_async so it only schedules a job when no lease for the given project is present. This ensures we don't end up scheduling hundreds of jobs when they won't be executed anyway.
* Re-organize queues to use for Sidekiqseparate-sidekiq-queuesYorick Peterse2016-10-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Dumping too many jobs in the same queue (e.g. the "default" queue) is a dangerous setup. Jobs that take a long time to process can effectively block any other work from being performed given there are enough of these jobs. Furthermore it becomes harder to monitor the jobs as a single queue could contain jobs for different workers. In such a setup the only reliable way of getting counts per job is to iterate over all jobs in a queue, which is a rather time consuming process. By using separate queues for various workers we have better control over throughput, we can add weight to queues, and we can monitor queues better. Some workers still use the same queue whenever their work is related. For example, the various CI pipeline workers use the same "pipeline" queue. This commit includes a Rails migration that moves Sidekiq jobs from the old queues to the new ones. This migration also takes care of doing the inverse if ever needed. This does require downtime as otherwise new jobs could be scheduled in the old queues after this migration completes. This commit also includes an RSpec test that blacklists the use of the "default" queue and ensures cron workers use the "cronjob" queue. Fixes gitlab-org/gitlab-ce#23370
* Restrict ProjectCacheWorker jobs to one per 15 minproject-cache-worker-leaseYorick Peterse2016-10-201-0/+27
| | | | | | | This ensures ProjectCacheWorker jobs for a given project are performed at most once per 15 minutes. This should reduce disk load a bit in cases where there are multiple pushes happening (which should schedule multiple ProjectCacheWorker jobs).
* Check if repo exists before attempting to update cache infoStan Hu2016-03-271-0/+3
| | | | Closes #14361
* Avoid cache building for super-weird case when repository root_ref is nilDmitriy Zaporozhets2015-07-171-1/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Store commit count in project tableadvanced-cacheDmitriy Zaporozhets2015-07-171-1/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Build missing cache items in background job after each pushDmitriy Zaporozhets2015-07-171-0/+9
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>