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",
|
"program": "/opt/odoo/hibou-suite/odoo-reload.py",
|
||||||
"args": [],
|
"args": [],
|
||||||
"console": "integratedTerminal"
|
"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 psutil
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
|
import sys
|
||||||
|
|
||||||
PID = 1
|
PID = 1
|
||||||
PNAME = 'odoo'
|
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
|
is_foreground = False
|
||||||
for proc in psutil.process_iter():
|
for proc in psutil.process_iter():
|
||||||
try:
|
try:
|
||||||
process_name = proc.name()
|
process_name = proc.name()
|
||||||
process_id = proc.pid
|
process_id = proc.pid
|
||||||
|
print('Inspecting %s:%s' % (process_id, process_name))
|
||||||
if process_id == PID:
|
if process_id == PID:
|
||||||
is_foreground = process_name == PNAME
|
is_foreground = process_name == PNAME
|
||||||
|
if not KILL_OTHER:
|
||||||
break
|
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):
|
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user