Skip to content

Commit

Permalink
Merge pull request #190 from intuit/stationeros-patch-15
Browse files Browse the repository at this point in the history
Update constants.py to externalise TTL
  • Loading branch information
stationeros committed Nov 8, 2023
2 parents 2c88af2 + 0f4acec commit d7e371f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion labs/TrapheusAI/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
GRAPH_DEFAULT_COLOR="cyan"
GRAPH_SELECTED_COLOR="red"
GRAPH_HEIGHT=600
GRAPH_WIDTH="100%"
GRAPH_WIDTH="100%"
TTL=3600
4 changes: 2 additions & 2 deletions labs/TrapheusAI/providers/github_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def connect(self, input: str):
return request_headers, request_params


@streamlit.cache_data(ttl=3600)
@streamlit.cache_data(ttl=constants.TTL)
def query(_self, input: str):
request_headers, request_params = _self.connect(input)
response = requests.get(constants.GITHUB_END_POINT + constants.GITHUB_SEARCH_PATH, params=request_params,
Expand All @@ -31,7 +31,7 @@ def query(_self, input: str):
response_body = response.json()
return response_body

@streamlit.cache_data(ttl=3600)
@streamlit.cache_data(ttl=constants.TTL)
def extract_data(_self, input: str):
formatted_results = []
data = _self.query(input).get("items", [])
Expand Down

0 comments on commit d7e371f

Please sign in to comment.