diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-10-25 16:01:24 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-10-25 16:02:36 +0200 |
commit | 3b4af59a5fed342bf7a4718dba6189cdf1d0c017 (patch) | |
tree | 01334aa305fe43e442a4ec8d583d55ed02501ca0 /spec/spec_helper.rb | |
parent | 9a6770388c0e93f98952a40cc88bb7f5ecd23631 (diff) | |
download | gitlab-ce-3b4af59a5fed342bf7a4718dba6189cdf1d0c017.tar.gz |
Don't schedule ProjectCacheWorker unless neededproject-cache-worker-scheduling
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.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b19f5824236..06d52f0f735 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -50,6 +50,12 @@ RSpec.configure do |config| example.run Rails.cache = caching_store end + + config.around(:each, :redis) do |example| + Gitlab::Redis.with(&:flushall) + example.run + Gitlab::Redis.with(&:flushall) + end end FactoryGirl::SyntaxRunner.class_eval do |