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
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-05 05:28:58 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-05 05:28:58 +0300
commitd07b2e09fe3d930cc912ef17f6c499bdc58b7b97 (patch)
treec33f3e8f110b8e8aee324892895bf8e7fdfb103d /lib
parent694ac54862d9b88ee0e82577d8fbf622534391bf (diff)
parent516bcabbf42d60db2ac989dce4c7187b2a1e5de9 (diff)
Merge branch 'timeout' into 'master'
Increase timeout for Git-over-HTTP requests. Fixes #2081 and https://gitlab.com/gitlab-org/gitlab-ce/issues/232. Normal web requests are bound by the `Rack::Timeout` timeout of 60 seconds, while Grack Git-over-HTTP requests are only bound by Unicorn's timeout which is now set to 1 hour, which should be plenty. The omnibus package should be updated to no longer use `unicorn['worker_timeout']` for the Unicorn timeout, but to set the `Slowpoke.timeout`. See merge request !1619
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/middleware/timeout.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/middleware/timeout.rb b/lib/gitlab/middleware/timeout.rb
new file mode 100644
index 00000000000..015600392b9
--- /dev/null
+++ b/lib/gitlab/middleware/timeout.rb
@@ -0,0 +1,13 @@
+module Gitlab
+ module Middleware
+ class Timeout < Rack::Timeout
+ GRACK_REGEX = /[-\/\w\.]+\.git\//.freeze
+
+ def call(env)
+ return @app.call(env) if env['PATH_INFO'] =~ GRACK_REGEX
+
+ super
+ end
+ end
+ end
+end