fix(qualys/dashboard): timeout 120s->300s + log erreurs sur _fetch_asset_ids_by_tag (manque ENV-PRD/REC sur gros tags)
This commit is contained in:
parent
5ec5271232
commit
dc9c197274
@ -905,10 +905,11 @@ def _fetch_asset_ids_by_tag(db, tag_name):
|
||||
]}
|
||||
}},
|
||||
auth=(qualys_user, qualys_pass),
|
||||
verify=False, timeout=120, proxies=proxies,
|
||||
verify=False, timeout=300, proxies=proxies,
|
||||
headers={"Content-Type": "application/json"}
|
||||
)
|
||||
if r.status_code != 200 or "SUCCESS" not in r.text:
|
||||
print(f"[fetch_tag {tag_name}] HTTP {r.status_code} - {r.text[:200]}")
|
||||
return set()
|
||||
ids = set()
|
||||
for block in r.text.split("<HostAsset>")[1:]:
|
||||
@ -917,7 +918,8 @@ def _fetch_asset_ids_by_tag(db, tag_name):
|
||||
if aid and aid.isdigit():
|
||||
ids.add(int(aid))
|
||||
return ids
|
||||
except Exception:
|
||||
except Exception as ex:
|
||||
print(f"[fetch_tag {tag_name}] {type(ex).__name__}: {ex}")
|
||||
return set()
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user