mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] athene: ignores, ability to restart other odoo processes
This commit is contained in:
@@ -43,6 +43,14 @@
|
||||
"program": "/opt/odoo/hibou-suite/odoo-reload.py",
|
||||
"args": [],
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "Odoo: reload foreground server, Kill Others",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "/opt/odoo/hibou-suite/odoo-reload.py",
|
||||
"args": ["KILL_OTHER"],
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
17
.theia/settings.json
Normal file
17
.theia/settings.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"workbench.colorTheme": "Hibou Dark",
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
"**/.svn": true,
|
||||
"**/.hg": true,
|
||||
"**/CVS": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/*.pyc": {"when": "$(basename).py"},
|
||||
"**/__pycache__": true
|
||||
},
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/.git/subtree-cache/**": true,
|
||||
"**/node_modules/**": true
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,31 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
import psutil
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
|
||||
PID = 1
|
||||
PNAME = 'odoo'
|
||||
PNAME_PYTHON = ['python']
|
||||
PNAME_KILL_OTHER = [PNAME] + PNAME_PYTHON
|
||||
KILL_OTHER = sys.argv[1] == 'KILL_OTHER' if len(sys.argv) >= 2 else False
|
||||
if KILL_OTHER:
|
||||
print('Will find other Odoo Processes and Kill them.')
|
||||
|
||||
is_foreground = False
|
||||
for proc in psutil.process_iter():
|
||||
try:
|
||||
process_name = proc.name()
|
||||
process_id = proc.pid
|
||||
print('Inspecting %s:%s' % (process_id, process_name))
|
||||
if process_id == PID:
|
||||
is_foreground = process_name == PNAME
|
||||
break
|
||||
if not KILL_OTHER:
|
||||
break
|
||||
if process_id != PID and KILL_OTHER and process_name in PNAME_KILL_OTHER:
|
||||
print('Killing %s:%s' % (process_id, process_name))
|
||||
os.kill(process_id, signal.SIGKILL)
|
||||
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user