mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-28 02:11:23 -05:00
remove shutdown_timeout logic in the web server, it's not actually needed
This commit is contained in:
parent
32108dcca2
commit
a4b8a71c68
@ -108,7 +108,7 @@ def main(cwd=None):
|
|||||||
print('')
|
print('')
|
||||||
|
|
||||||
# Start OnionShare http service in new thread
|
# 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.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
|
@ -135,14 +135,6 @@ def get_stay_open():
|
|||||||
"""
|
"""
|
||||||
return 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?
|
# Are we running in GUI mode?
|
||||||
gui_mode = False
|
gui_mode = False
|
||||||
def set_gui_mode():
|
def set_gui_mode():
|
||||||
@ -368,14 +360,13 @@ def force_shutdown():
|
|||||||
func()
|
func()
|
||||||
|
|
||||||
|
|
||||||
def start(port, stay_open=False, shutdown_timeout=0):
|
def start(port, stay_open=False):
|
||||||
"""
|
"""
|
||||||
Start the flask web server.
|
Start the flask web server.
|
||||||
"""
|
"""
|
||||||
generate_slug()
|
generate_slug()
|
||||||
|
|
||||||
set_stay_open(stay_open)
|
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)
|
# 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'):
|
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')
|
self.app.stay_open = not self.settings.get('close_after_first_download')
|
||||||
|
|
||||||
# start onionshare http service in new thread
|
# 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.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user