diff options
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r-- | app/models/ci/build.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 7cf8bdd968b..b65daa376d2 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -80,7 +80,7 @@ module Ci before_save :ensure_token before_destroy { unscoped_project } - after_create do |build| + after_create unless: :importing? do |build| run_after_commit { BuildHooksWorker.perform_async(build.id) } end @@ -468,7 +468,14 @@ module Ci end def cache - [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 @@ -498,7 +505,6 @@ module Ci end def valid_dependency? - return false unless complete? return false if artifacts_expired? return false if erased? |