mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 04:02:40 -03:00
remove shutdown_timeout logic in the web server, it's not actually needed
This commit is contained in:
parent
32108dcca2
commit
a4b8a71c68
3 changed files with 3 additions and 12 deletions
|
@ -108,7 +108,7 @@ def main(cwd=None):
|
|||
print('')
|
||||
|
||||
# Start OnionShare http service in new thread
|
||||
t = threading.Thread(target=web.start, args=(app.port, app.stay_open, app.shutdown_timeout))
|
||||
t = threading.Thread(target=web.start, args=(app.port, app.stay_open))
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
|
|
|
@ -135,14 +135,6 @@ def get_stay_open():
|
|||
"""
|
||||
return stay_open
|
||||
|
||||
shutdown_timeout = 0
|
||||
def set_shutdown_timeout(new_shutdown_timeout):
|
||||
"""
|
||||
Set shutdown_timeout variable.
|
||||
"""
|
||||
global shutdown_timeout
|
||||
shutdown_timeout = new_shutdown_timeout
|
||||
|
||||
# Are we running in GUI mode?
|
||||
gui_mode = False
|
||||
def set_gui_mode():
|
||||
|
@ -368,14 +360,13 @@ def force_shutdown():
|
|||
func()
|
||||
|
||||
|
||||
def start(port, stay_open=False, shutdown_timeout=0):
|
||||
def start(port, stay_open=False):
|
||||
"""
|
||||
Start the flask web server.
|
||||
"""
|
||||
generate_slug()
|
||||
|
||||
set_stay_open(stay_open)
|
||||
set_shutdown_timeout(shutdown_timeout)
|
||||
|
||||
# In Whonix, listen on 0.0.0.0 instead of 127.0.0.1 (#220)
|
||||
if os.path.exists('/usr/share/anon-ws-base-files/workstation'):
|
||||
|
|
|
@ -258,7 +258,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
self.app.stay_open = not self.settings.get('close_after_first_download')
|
||||
|
||||
# start onionshare http service in new thread
|
||||
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, self.app.shutdown_timeout))
|
||||
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open))
|
||||
t.daemon = True
|
||||
t.start()
|
||||
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
||||
|
|
Loading…
Reference in a new issue