Skip to content
Snippets Groups Projects
Unverified Commit 92f1cbeb authored by Stephen Medina's avatar Stephen Medina Committed by Martin Trigaux
Browse files

[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
parent 58d99909
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment