Added restart to client for testing

This commit is contained in:
Artem30801
2020-02-25 16:32:43 +03:00
parent e5c60637fa
commit e0c6fdc720

View File

@@ -238,7 +238,20 @@ def _response_time(*args, **kwargs):
if __name__ == "__main__":
startup_cwd = os.getcwd()
import threading
def restart(): # move to core
args = sys.argv[:]
logging.info('Restarting {}'.format(args))
args.insert(0, sys.executable)
if sys.platform == 'win32':
args = ['"%s"' % arg for arg in args]
os.chdir(startup_cwd)
os.execv(sys.executable, args)
def mock_telem():
while True:
time.sleep(5)