mirror of
https://github.com/ONLYOFFICE/build_tools.git
synced 2026-04-07 14:06:31 +08:00
[develop] Add information log message to restart_win_rabbit
This commit is contained in:
@ -8,6 +8,13 @@ import dependence
|
|||||||
import traceback
|
import traceback
|
||||||
import develop
|
import develop
|
||||||
|
|
||||||
|
# if (sys.version_info[0] >= 3):
|
||||||
|
# unicode = str
|
||||||
|
|
||||||
|
# host_platform = base.host_platform()
|
||||||
|
# if (host_platform == 'windows'):
|
||||||
|
# import libwindows
|
||||||
|
|
||||||
base_dir = base.get_script_dir(__file__)
|
base_dir = base.get_script_dir(__file__)
|
||||||
|
|
||||||
def install_module(path):
|
def install_module(path):
|
||||||
@ -21,11 +28,18 @@ def find_rabbitmqctl(base_path):
|
|||||||
return base.find_file(os.path.join(base_path, 'RabbitMQ Server'), 'rabbitmqctl.bat')
|
return base.find_file(os.path.join(base_path, 'RabbitMQ Server'), 'rabbitmqctl.bat')
|
||||||
|
|
||||||
def restart_win_rabbit():
|
def restart_win_rabbit():
|
||||||
|
# todo maybe restarting is not relevant after many years and versions?
|
||||||
base.print_info('restart RabbitMQ node to prevent "Erl.exe high CPU usage every Monday morning on Windows" https://groups.google.com/forum/#!topic/rabbitmq-users/myl74gsYyYg')
|
base.print_info('restart RabbitMQ node to prevent "Erl.exe high CPU usage every Monday morning on Windows" https://groups.google.com/forum/#!topic/rabbitmq-users/myl74gsYyYg')
|
||||||
rabbitmqctl = find_rabbitmqctl(os.environ['PROGRAMW6432']) or find_rabbitmqctl(os.environ['ProgramFiles(x86)'])
|
rabbitmqctl = find_rabbitmqctl(os.environ['PROGRAMW6432']) or find_rabbitmqctl(os.environ['ProgramFiles(x86)'])
|
||||||
if rabbitmqctl is not None:
|
if rabbitmqctl is not None:
|
||||||
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['stop_app'])
|
try:
|
||||||
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['start_app'])
|
# code = libwindows.sudo(unicode(sys.executable), ['net', 'stop', 'rabbitmq'])
|
||||||
|
# code = libwindows.sudo(unicode(sys.executable), ['net', 'start', 'rabbitmq'])
|
||||||
|
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['stop_app'])
|
||||||
|
base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['start_app'])
|
||||||
|
except SystemExit:
|
||||||
|
base.print_error('Perhaps Erlang cookies are different: Replace %userprofile%/.erlang.cookie with %WINDIR%/System32/config/systemprofile/.erlang.cookie')
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
base.print_info('Missing rabbitmqctl.bat')
|
base.print_info('Missing rabbitmqctl.bat')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user