Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Jan 3, 2024
1 parent 1a7b43f commit 6a9320f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions foursight_core/react/api/react_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,22 @@ def reactapi_header(self, request: dict, env: str) -> Response:
data["portal_access_key_erro"] = True
return self.create_success_response(data)

def _get_gitinfo(self) -> dict:
@function_cache
def _get_gitinfo(self, package: str = None) -> Optional[dict]:
if not package:
if gitinfo := self._get_gitinfo("chalicelib_smaht"):
return gitinfo
elif gitinfo := self._get_gitinfo("chalicelib_fourfront"):
return gitinfo
elif gitinfo := self._get_gitinfo("chalicelib_cgap"):
return gitinfo
else:
return None
try:
with open("gitinfo.json", "r") as f:
with open(f"{package}/gitinfo.json", "r") as f:
return json.load(f)
except Exception as e:
return {"error": str(e)}
except Exception:
return None

@function_cache(key=lambda self, request, env: env) # new as of 2023-04-27
def _reactapi_header_cache(self, request: dict, env: str) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "foursight-core"
version = "5.2.0.1b10" # TODO: To become 5.3.0
version = "5.2.0.1b11" # TODO: To become 5.3.0
description = "Serverless Chalice Application for Monitoring"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 6a9320f

Please sign in to comment.