Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-01-09 18:59:46 +0300
committerJacob Vosmaer <jacob@gitlab.com>2018-01-09 18:59:46 +0300
commitd805cd3606f21c504e34f7266c1100d688ea1cf5 (patch)
tree4ed35a68683922c51ef7a5bd9d205cdbefbbe959 /lib/gitlab/workhorse.rb
parent8de1bb9e74a00766c663b1cdf8c7b49ddc060caf (diff)
Add option to disable git archive caching in workhorse
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r--lib/gitlab/workhorse.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index 5ab6cd5a4ef..ce6d0422c1f 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -97,6 +97,9 @@ module Gitlab
)
end
+ # If present DisableCache must be a Boolean. Otherwise workhorse ignores it.
+ params['DisableCache'] = true if git_archive_cache_disabled?
+
[
SEND_DATA_HEADER,
"git-archive:#{encode(params)}"
@@ -244,6 +247,10 @@ module Gitlab
right_commit_id: diff_refs.head_sha
}
end
+
+ def git_archive_cache_disabled?
+ ENV['WORKHORSE_ARCHIVE_CACHE_DISABLED'].present? || Feature.enabled?(:workhorse_archive_cache_disabled)
+ end
end
end
end