mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ca_status: add HTTP timeout 30 seconds
CA sometimes "forgot to answer" so we have to add timeout for http connection and ask again rather than wait for infinity. https://pagure.io/freeipa/issue/6766 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
@@ -140,6 +140,8 @@ DEFAULT_CONFIG = (
|
||||
|
||||
# Time to wait for a service to start, in seconds
|
||||
('startup_timeout', 300),
|
||||
# How long http connection should wait for reply [seconds].
|
||||
('http_timeout', 30),
|
||||
|
||||
# Web Application mount points
|
||||
('mount_ipa', '/ipa/'),
|
||||
|
||||
@@ -123,7 +123,9 @@ def ca_status(ca_host=None):
|
||||
if ca_host is None:
|
||||
ca_host = api.env.ca_host
|
||||
status, _headers, body = http_request(
|
||||
ca_host, 8080, '/ca/admin/ca/getStatus')
|
||||
ca_host, 8080, '/ca/admin/ca/getStatus',
|
||||
# timeout: CA sometimes forgot to answer, we have to try again
|
||||
timeout=api.env.http_timeout)
|
||||
if status == 503:
|
||||
# Service temporarily unavailable
|
||||
return status
|
||||
|
||||
Reference in New Issue
Block a user