Commit e6780501 authored by Hiroyuki Sato's avatar Hiroyuki Sato

Refactor project_cache_worker_key

parent 0adedbb4
...@@ -42,6 +42,6 @@ class ProjectCacheWorker ...@@ -42,6 +42,6 @@ class ProjectCacheWorker
end end
def project_cache_worker_key(project_id, statistics) 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
end end
...@@ -7,7 +7,7 @@ describe ProjectCacheWorker do ...@@ -7,7 +7,7 @@ describe ProjectCacheWorker do
let(:worker) { described_class.new } let(:worker) { described_class.new }
let(:project) { create(:project, :repository) } 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(:lease_timeout) { ProjectCacheWorker::LEASE_TIMEOUT }
let(:statistics) { [] } let(:statistics) { [] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment