diff --git a/labs/TrapheusAI/constants.py b/labs/TrapheusAI/constants.py index 65e1b85..aa4c8c5 100644 --- a/labs/TrapheusAI/constants.py +++ b/labs/TrapheusAI/constants.py @@ -5,4 +5,5 @@ GRAPH_DEFAULT_COLOR="cyan" GRAPH_SELECTED_COLOR="red" GRAPH_HEIGHT=600 -GRAPH_WIDTH="100%" \ No newline at end of file +GRAPH_WIDTH="100%" +TTL=3600 diff --git a/labs/TrapheusAI/providers/github_provider.py b/labs/TrapheusAI/providers/github_provider.py index 4b9b938..ba3c44b 100644 --- a/labs/TrapheusAI/providers/github_provider.py +++ b/labs/TrapheusAI/providers/github_provider.py @@ -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, @@ -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", [])