diff --git a/application/database/db.py b/application/database/db.py index bbac2fca..010aeed2 100644 --- a/application/database/db.py +++ b/application/database/db.py @@ -76,8 +76,6 @@ class Node(BaseModel): # type: ignore name, section, subsection, - ntype, - description, version, section_id, name="uq_node", diff --git a/application/prompt_client/prompt_client.py b/application/prompt_client/prompt_client.py index d8547f7c..4ad8b34d 100644 --- a/application/prompt_client/prompt_client.py +++ b/application/prompt_client/prompt_client.py @@ -84,9 +84,9 @@ def instance(cls, database: db.Node_collection, ai_client: Any): cls.__playwright = sync_playwright().start() nltk.download("punkt") nltk.download("stopwords") - cls.__webkit = cls.__playwright.webkit + cls.__firefox = cls.__playwright.firefox cls.__browser = ( - cls.__webkit.launch() + cls.__firefox.launch() ) # headless=False, slow_mo=1000) cls.__context = cls.__browser.new_context() diff --git a/application/utils/gap_analysis.py b/application/utils/gap_analysis.py index 9e4631a5..e917beb5 100644 --- a/application/utils/gap_analysis.py +++ b/application/utils/gap_analysis.py @@ -56,18 +56,22 @@ def preload(target_url: str): res1 = requests.get( f"{target_url}/rest/v1/map_analysis?standard={sa}&standard={sb}" ) - if res1.json(): + if res1.status_code != 200: + print(f"{sa}->{sb} returned {res1.status_code}") + elif res1.json(): if res1.json().get("result"): if f"{sa}->{sb}" in waiting: waiting.remove(f"{sa}->{sb}") res2 = requests.get( f"{target_url}/rest/v1/map_analysis?standard={sb}&standard={sa}" ) - if res2.json(): + if res2.status_code != 200: + print(f"{sb}->{sa} returned {res1.status_code}") + elif res2.json(): if res2.json().get("result"): if f"{sb}->{sa}" in waiting: waiting.remove(f"{sb}->{sa}") print(f"calculating {len(waiting)} gap analyses") - print(waiting) + # print(waiting) time.sleep(30) print("map analysis preloaded successfully") diff --git a/application/web/web_main.py b/application/web/web_main.py index c78730cd..6d3e35b7 100644 --- a/application/web/web_main.py +++ b/application/web/web_main.py @@ -263,6 +263,7 @@ def gap_analysis() -> Any: try: res = job.Job.fetch(id=gap_analysis_dict.get("job_id"), connection=conn) except exceptions.NoSuchJobError as nje: + logger.error(f"Could not find job id for gap analysis {standards}") abort(404, "No such job") if ( res.get_status() != job.JobStatus.FAILED