diff options
author | Hiroyuki Sato <sathiroyuki@gmail.com> | 2019-04-05 00:17:52 +0900 |
---|---|---|
committer | Hiroyuki Sato <sathiroyuki@gmail.com> | 2019-04-05 00:22:56 +0900 |
commit | e6780501cbfd0cae31fadd15b2964204171091cc (patch) | |
tree | ae2bb7fe92b0114019abbe6d4c861647b53e7a8a | |
parent | 0adedbb4822a8daaa215b33c88ace136c31d042d (diff) | |
download | gitlab-ce-e6780501cbfd0cae31fadd15b2964204171091cc.tar.gz |
Refactor project_cache_worker_key
-rw-r--r-- | app/workers/project_cache_worker.rb | 2 | ||||
-rw-r--r-- | spec/workers/project_cache_worker_spec.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/project_cache_worker.rb b/app/workers/project_cache_worker.rb index 73eb461768c..2b25b96a6f8 100644 --- a/app/workers/project_cache_worker.rb +++ b/app/workers/project_cache_worker.rb @@ -42,6 +42,6 @@ class ProjectCacheWorker end def project_cache_worker_key(project_id, statistics) - (["project_cache_worker", project_id] + statistics.sort).join(":") + ["project_cache_worker", project_id, *statistics.sort].join(":") end end diff --git a/spec/workers/project_cache_worker_spec.rb b/spec/workers/project_cache_worker_spec.rb index 724947228b7..7053bfc2bfd 100644 --- a/spec/workers/project_cache_worker_spec.rb +++ b/spec/workers/project_cache_worker_spec.rb @@ -7,7 +7,7 @@ describe ProjectCacheWorker do let(:worker) { described_class.new } let(:project) { create(:project, :repository) } - let(:lease_key) { (["project_cache_worker", project.id] + statistics.sort).join(":") } + let(:lease_key) { ["project_cache_worker", project.id, *statistics.sort].join(":") } let(:lease_timeout) { ProjectCacheWorker::LEASE_TIMEOUT } let(:statistics) { [] } |