Rev1801, Fix open file limit set on Linux

This commit is contained in:
shortcutme 2017-01-06 10:31:47 +01:00
parent 431415c052
commit 6f2445c417
2 changed files with 3 additions and 3 deletions
src/util

View file

@ -15,8 +15,8 @@ def setMaxfilesopened(limit):
import resource
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
if soft < limit:
logging.debug("Current RLIMIT_NOFILE: %s, changing to %s..." % (soft, limit))
resource.setrlimit(resource.RLIMIT_NOFILE, (soft, hard))
logging.debug("Current RLIMIT_NOFILE: %s (max: %s), changing to %s..." % (soft, hard, limit))
resource.setrlimit(resource.RLIMIT_NOFILE, (limit, hard))
return True
except Exception, err: