phenomenon1981 commited on
Commit
3b6bff3
1 Parent(s): 8d994a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,11 +17,11 @@ proc1=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
17
  def reset_queue_periodically():
18
  start_time = time.time()
19
  while True:
20
- if time.time() - start_time > 300: # 300 seconds
21
  queue.queue.clear()
22
  start_time = time.time()
23
 
24
- reset_queue_thread = Thread(target=reset_queue_periodically)
25
  reset_queue_thread.start()
26
 
27
 
 
17
  def reset_queue_periodically():
18
  start_time = time.time()
19
  while True:
20
+ if time.time() - start_time >= 300: # 5 minutes
21
  queue.queue.clear()
22
  start_time = time.time()
23
 
24
+ reset_queue_thread = Thread(target=reset_queue_periodically, daemon=True)
25
  reset_queue_thread.start()
26
 
27