Rev1801, Fix open file limit set on Linux
This commit is contained in:
parent
431415c052
commit
6f2445c417
2 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.5.1"
|
||||
self.rev = 1800
|
||||
self.rev = 1801
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.config_file = "zeronet.conf"
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue