Refactor project_cache_worker_key

This commit is contained in:
Hiroyuki Sato 2019-04-05 00:17:52 +09:00
parent 0adedbb482
commit e6780501cb
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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) { [] }