ksvmuralidhar commited on
Commit
67f6359
·
verified ·
1 Parent(s): 508a5c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -170,10 +170,8 @@ def index():
170
  if len(final_df) <= 1:
171
  result_str += f'''<div><p class="unavailable">This app is temporarily unavailable</p></div>'''
172
  else:
173
- # last_update_utc = datetime.strptime(os.getenv("NEWSFETCHTIME"), '%Y-%m-%d %H:%M:%S.%f')
174
  last_update_utc = datetime.strptime(redis_client.get('NEWSFETCHTIME'), '%Y-%m-%d %H:%M:%S.%f')
175
- # last_update_utc = last_update_utc.strftime("%Y-%m-%d %H:%M:%S")
176
- last_update_mins = str(int(np.round((datetime.now() - last_update_utc).minutes, 0)))
177
  result_str += f'<p class="srctxt">News aggregated from <b>{src_str}</b>.<br><br>Updated {last_update_mins} mins ago</p>'
178
 
179
  result_str += '''
 
170
  if len(final_df) <= 1:
171
  result_str += f'''<div><p class="unavailable">This app is temporarily unavailable</p></div>'''
172
  else:
 
173
  last_update_utc = datetime.strptime(redis_client.get('NEWSFETCHTIME'), '%Y-%m-%d %H:%M:%S.%f')
174
+ last_update_mins = str((datetime.now() - last_update_utc).seconds // 60)
 
175
  result_str += f'<p class="srctxt">News aggregated from <b>{src_str}</b>.<br><br>Updated {last_update_mins} mins ago</p>'
176
 
177
  result_str += '''