mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +00:00
Add more docs & tweak max redirect wait time
This commit is contained in:
@@ -509,9 +509,12 @@ class PrefixRedirectHandler(BaseHandler):
|
|||||||
# This is important in many distributed proxy implementations - those are often eventually
|
# This is important in many distributed proxy implementations - those are often eventually
|
||||||
# consistent and can take upto a couple of seconds to actually apply throughout the cluster.
|
# consistent and can take upto a couple of seconds to actually apply throughout the cluster.
|
||||||
times = int(self.get_argument('times', 0))
|
times = int(self.get_argument('times', 0))
|
||||||
if times > 12:
|
# FIXME: should this be customizable? At times=7, it'll wait for about 12s the last time.
|
||||||
|
if times > 7:
|
||||||
# We stop if we've been redirected 12 times.
|
# We stop if we've been redirected 12 times.
|
||||||
raise web.HTTPError(500)
|
raise web.HTTPError(500)
|
||||||
|
# We want this to be 0 the first time, and then increase after that. This formula seems to work,
|
||||||
|
# but we might wanna make it customizable?
|
||||||
yield gen.sleep(( (2 ** times) - 1)/10)
|
yield gen.sleep(( (2 ** times) - 1)/10)
|
||||||
uri = self.request.uri
|
uri = self.request.uri
|
||||||
if uri.startswith(self.base_url):
|
if uri.startswith(self.base_url):
|
||||||
|
Reference in New Issue
Block a user