Skip to content

Commit

Permalink
fix gap analysis bug where we wouldn't remove calculated ga from wait…
Browse files Browse the repository at this point in the history
…ing list
  • Loading branch information
northdpole committed Jun 26, 2024
1 parent ff1f904 commit 428c7f8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions application/utils/gap_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,34 @@ def preload(target_url: str):
)
if res1.status_code != 200:
print(f"{sa}->{sb} returned {res1.status_code}")
elif res1.json():
if res1.json().get("result"):
else:
tojson = res1.json()
if tojson.get("result"):
forward = True
if f"{sa}->{sb}" in waiting:
print(f"gap analysis {sa}->{sb} returned")
waiting.remove(f"{sa}->{sb}")
elif tojson.get("job_id"):
print("{sa}->{sb} waiting")
pass
else:
print(f"{sa}->{sb} returned 200 but has no 'result' key")
print(f"{sa}->{sb} returned 200 but has no 'result' or 'job_id' key")
res2 = requests.get(
f"{target_url}/rest/v1/map_analysis?standard={sb}&standard={sa}"
)
if res2.status_code != 200:
print(f"{sb}->{sa} returned {res1.status_code}")
elif res2.json():
else:
print(f"{sb}->{sa} success")
if res2.json().get("result"):
backward = True
if f"{sb}->{sa}" in waiting:
print(f"gap analysis {sb}->{sa} returned")
waiting.remove(f"{sb}->{sa}")
elif tojson.get("job_id"):
print("{sb}->{sa} waiting")
else:
print(f"{sb}->{sa} returned 200 but has no 'result' key")
print(f"{sb}->{sa} returned 200 but has no 'result' or 'job_id' key")

if forward and backward:
print(
Expand Down

0 comments on commit 428c7f8

Please sign in to comment.