pvanand commited on
Commit
e7c157d
1 Parent(s): 288a296

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -227,8 +227,12 @@ def fetch_news(query, num_results=20):
227
  return []
228
 
229
  @cache(expire=3600)
 
 
 
 
230
  def analyze_news(query):
231
- news_data = fetch_news(query)
232
 
233
  if not news_data:
234
  return "Failed to fetch news data.", []
 
227
  return []
228
 
229
  @cache(expire=3600)
230
+ def cached_fetch_news(query: str, timestamp: int):
231
+ return fetch_news(query)
232
+
233
+
234
  def analyze_news(query):
235
+ news_data = cached_fetch_news(query)
236
 
237
  if not news_data:
238
  return "Failed to fetch news data.", []