Browse Source

[FIX] support psutils >= 4.0

master
Stephen Medina 5 years ago
committed by Harald Welte
parent
commit
36ecb63f2c
  1. 3
      openerp/service/server.py

3
openerp/service/server.py

@ -47,7 +47,8 @@ SLEEP_INTERVAL = 60 # 1 min
def memory_info(process):
""" psutil < 2.0 does not have memory_info, >= 3.0 does not have
get_memory_info """
return (getattr(process, 'memory_info', None) or process.get_memory_info)()
pmem = (getattr(process, 'memory_info', None) or process.get_memory_info)()
return (pmem.rss, pmem.vms)
#----------------------------------------------------------
# Werkzeug WSGI servers patched

Loading…
Cancel
Save