diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-10-08 07:51:07 +0000 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-10-08 07:51:07 +0000 |
commit | 94611607e56f0e0f0b05682481db79ff99e9e34e (patch) | |
tree | d2efea4ac3a6ec9aa3feabeb5c2187cfdd91d8f6 /lib/tasks | |
parent | 720968cc8799f665f4f4392e80bf8dfe88fdd69b (diff) | |
parent | 28ca8502c254d5c3edfb7ece36fc365e7a715df0 (diff) | |
download | gitlab-ce-94611607e56f0e0f0b05682481db79ff99e9e34e.tar.gz |
Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (292 commits)
Deletes extra empty line breaking the build
Optimize the `award_user_list` helper spec
Fix typo and add he MWBS accronym for "Merge When Build Succeeds"
Added missing content and improved layout
ExpireBuildArtifactsWorker query builds table without ordering enqueuing one job per build to cleanup
Improve the contribution and MR review guide
Updates test in order to look for link
Make projects API docs match parameter style
Fix Event#reset_project_activity updates
Update user whitelist reject message
Call ensure_secret_token! in secret token test's before block since it would be called in an initializer.
Add a CHANGELOG for CacheMarkdownField
Enable CacheMarkdownField for the remaining models
Make search results use the markdown cache columns, treating them consistently
Use CacheMarkdownField for notes
Add markdown cache columns to the database, but don't use them yet
Update issue board spec
Link to Registry docs from project settings
Truncate long labels with ellipsis in labels page
Improve issue load time performance by avoiding ORDER BY in find_by call
...
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/cache.rake | 43 | ||||
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 2 |
2 files changed, 28 insertions, 17 deletions
diff --git a/lib/tasks/cache.rake b/lib/tasks/cache.rake index 2214f855200..a95a3455a4a 100644 --- a/lib/tasks/cache.rake +++ b/lib/tasks/cache.rake @@ -1,22 +1,33 @@ namespace :cache do - CLEAR_BATCH_SIZE = 1000 # There seems to be no speedup when pushing beyond 1,000 - REDIS_SCAN_START_STOP = '0' # Magic value, see http://redis.io/commands/scan + namespace :clear do + REDIS_CLEAR_BATCH_SIZE = 1000 # There seems to be no speedup when pushing beyond 1,000 + REDIS_SCAN_START_STOP = '0' # Magic value, see http://redis.io/commands/scan - desc "GitLab | Clear redis cache" - task :clear => :environment do - Gitlab::Redis.with do |redis| - cursor = REDIS_SCAN_START_STOP - loop do - cursor, keys = redis.scan( - cursor, - match: "#{Gitlab::Redis::CACHE_NAMESPACE}*", - count: CLEAR_BATCH_SIZE - ) - - redis.del(*keys) if keys.any? - - break if cursor == REDIS_SCAN_START_STOP + desc "GitLab | Clear redis cache" + task redis: :environment do + Gitlab::Redis.with do |redis| + cursor = REDIS_SCAN_START_STOP + loop do + cursor, keys = redis.scan( + cursor, + match: "#{Gitlab::Redis::CACHE_NAMESPACE}*", + count: REDIS_CLEAR_BATCH_SIZE + ) + + redis.del(*keys) if keys.any? + + break if cursor == REDIS_SCAN_START_STOP + end end end + + desc "GitLab | Clear database cache (in the background)" + task db: :environment do + ClearDatabaseCacheWorker.perform_async + end + + task all: [:db, :redis] end + + task clear: 'cache:clear:all' end diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index bb7eb852f1b..210899882b4 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -78,7 +78,7 @@ namespace :gitlab do f.puts "PATH=#{ENV['PATH']}" end - Gitlab::Shell.new.generate_and_link_secret_token + Gitlab::Shell.ensure_secret_token! end desc "GitLab | Setup gitlab-shell" |