From 43e0ecf89882200e23ad59118199576f2070b6d0 Mon Sep 17 00:00:00 2001 From: Marc Udoff Date: Thu, 23 Jul 2020 12:35:27 -0400 Subject: [PATCH] Do not warn if mem_warning_threshold is 0 Fixes #59 --- nbresuse/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbresuse/api.py b/nbresuse/api.py index 6ec3148..8f2ba5f 100644 --- a/nbresuse/api.py +++ b/nbresuse/api.py @@ -36,7 +36,7 @@ async def get(self): mem_limit = config.mem_limit limits = {"memory": {"rss": mem_limit}} - if config.mem_limit: + if config.mem_limit and config.mem_warning_threshold != 0: limits["memory"]["warn"] = (mem_limit - rss) < ( mem_limit * config.mem_warning_threshold )