[FIX] server: support psutils >= 4.0
In version 3, process.memory_info() returns only rss and vms In version 4, it now returns rss, vms, shared, text, lib, data and dirty Automatic unpacking is no longer possible in 4.0 Fixes #11052, Closes #11459
This commit is contained in:
parent
58d99909ec
commit
92f1cbeb6f
|
@ -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…
Reference in New Issue