File size: 613 Bytes
b9e402d
 
 
 
 
04b15b1
 
c90151d
 
f624d68
 
 
079300d
04b15b1
 
 
 
c90151d
079300d
f624d68
 
079300d
f624d68
 
 
079300d
c90151d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# found on https://stackoverflow.com/a/52130355 to fix infinite recursion with ssl
# at the beginning of the script
import gevent.monkey
gevent.monkey.patch_all()

import sys

import gradio as gr

import list_repos
import refresh_lists

def refresh_on_submit(progress=gr.Progress(track_tqdm=True)):
    try:
        refresh_repos()
    except:
        raise gr.Error(str(sys.exc_info()))

def refresh_repos():
    list_repos.write_repos_to_db()

def refresh_files():
    while True:
        refresh_lists.refresh_oldest_repo()

demo = gr.Interface(fn=refresh_on_submit, inputs=None, outputs="text")
demo.launch()