mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
prevent while loop using 100% cpu
This commit is contained in:
parent
47118e62a3
commit
1afbca27e0
@ -411,8 +411,8 @@ class Interface:
|
||||
|
||||
def run_until_interrupted(self, thread, path_to_local_server):
|
||||
try:
|
||||
while 1:
|
||||
pass
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
except (KeyboardInterrupt, OSError):
|
||||
print("Keyboard interruption in main thread... closing server.")
|
||||
thread.keep_running = False
|
||||
|
@ -6,7 +6,7 @@ old_version=$(grep -Po "(?<=version=')[^']+(?=')" setup.py)
|
||||
echo "Current version is $old_version. New version?"
|
||||
read new_version
|
||||
sed -i "s/version='$old_version'/version='$new_version'/g" setup.py
|
||||
echo $new_version > gradio/version.txt
|
||||
|
||||
read -p "npm build? " -n 1 -r
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
@ -15,7 +15,13 @@ then
|
||||
cd ..
|
||||
fi
|
||||
|
||||
aws s3 cp gradio/frontend s3://gradio/$new_version/ --recursive
|
||||
read -p "frontend updates? " -n 1 -r
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
aws s3 cp gradio/frontend s3://gradio/$new_version/ --recursive
|
||||
echo $new_version > gradio/version.txt
|
||||
fi
|
||||
|
||||
rm -r dist/*
|
||||
rm -r build/*
|
||||
python setup.py sdist bdist_wheel
|
||||
|
Loading…
Reference in New Issue
Block a user