forked from GithubBackups/healthchecks
Fix default values for timeout and grace parameters in API reference.
This commit is contained in:
parent
dab0c4200e
commit
ccba5e8731
@ -276,15 +276,19 @@ def serve_doc(request, doc="introduction"):
|
||||
if not os.path.exists(path):
|
||||
raise Http404("not found")
|
||||
|
||||
replaces = {
|
||||
"{{ default_timeout }}": str(int(DEFAULT_TIMEOUT.total_seconds())),
|
||||
"{{ default_grace }}": str(int(DEFAULT_GRACE.total_seconds())),
|
||||
"SITE_NAME": settings.SITE_NAME,
|
||||
"SITE_ROOT": settings.SITE_ROOT,
|
||||
"PING_ENDPOINT": settings.PING_ENDPOINT,
|
||||
"IMG_URL": os.path.join(settings.STATIC_URL, "img/docs"),
|
||||
"PING_EMAIL": "your-uuid-here@%s" % settings.PING_EMAIL_DOMAIN,
|
||||
}
|
||||
|
||||
content = open(path, "r", encoding="utf-8").read()
|
||||
content = content.replace("SITE_NAME", settings.SITE_NAME)
|
||||
content = content.replace("SITE_ROOT", settings.SITE_ROOT)
|
||||
content = content.replace("PING_URL", settings.PING_ENDPOINT + "your-uuid-here")
|
||||
content = content.replace("PING_ENDPOINT", settings.PING_ENDPOINT)
|
||||
content = content.replace("IMG_URL", os.path.join(settings.STATIC_URL, "img/docs"))
|
||||
content = content.replace(
|
||||
"PING_EMAIL", "your-uuid-here@%s" % settings.PING_EMAIL_DOMAIN
|
||||
)
|
||||
for placeholder, value in replaces.items():
|
||||
content = content.replace(placeholder, value)
|
||||
|
||||
ctx = {
|
||||
"page": "docs",
|
||||
|
@ -86,7 +86,7 @@ one or more tags.</p>
|
||||
specified value.</p>
|
||||
<p>This parameter can be repeated multiple times.</p>
|
||||
<p>Example:</p>
|
||||
<p><code>SITE_ROOT/api/v1/checks/?tag=foo&amp;tag=bar</code></p>
|
||||
<p><code>SITE_ROOT/api/v1/checks/?tag=foo&tag=bar</code></p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Example Request</h3>
|
||||
|
@ -66,7 +66,7 @@ tag=<value>
|
||||
|
||||
Example:
|
||||
|
||||
`SITE_ROOT/api/v1/checks/?tag=foo&tag=bar`
|
||||
`SITE_ROOT/api/v1/checks/?tag=foo&tag=bar`
|
||||
|
||||
### Example Request
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user