acecalisto3 commited on
Commit
1e4b6d9
1 Parent(s): 304a527

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -282,9 +282,14 @@ with gr.Blocks() as demo:
282
  async def update_feed_content():
283
  return generate_rss_feed()
284
 
285
- # with the corrected implementation:
286
- feed_updater = gr.Timer(interval=300) # Set interval here directly on Timer
287
- feed_updater.tick(fn=update_feed_content, outputs=feed_content)
 
 
 
 
 
288
 
289
  if __name__ == "__main__":
290
  demo.launch()
 
282
  async def update_feed_content():
283
  return generate_rss_feed()
284
 
285
+ # Periodic update loop
286
+ async def periodic_update():
287
+ while True:
288
+ await asyncio.sleep(300) # Wait for 5 minutes
289
+ await update_feed_content()
290
+
291
+ # Start the periodic update task
292
+ asyncio.create_task(periodic_update())
293
 
294
  if __name__ == "__main__":
295
  demo.launch()