Refactor Ci::Build#cache

This commit is contained in:
Matija Čupić 2018-01-04 19:43:31 +01:00
parent 8cc14dd537
commit 2682966829
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 7 additions and 4 deletions

View File

@ -461,11 +461,14 @@ module Ci
end
def cache
if options[:cache] && project.jobs_cache_index
options[:cache].merge(key: "#{options[:cache][:key]}:#{project.jobs_cache_index}")
else
[options[:cache]]
cache = options[:cache]
if cache && project.jobs_cache_index
cache = cache.merge(
key: "#{cache[:key]}:#{project.jobs_cache_index}")
end
[cache]
end
def credentials