add unlimited number of open file when start nabu
This can done by calling the following fonction
def increase_max_number_file():
"""increase the maximal number of file the software can open within respect of the hard limit"""
try:
import resource
except ImportError:
_logger.debug("No resource module available")
else:
if hasattr(resource, "RLIMIT_NOFILE"):
try:
hard_nofile = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
resource.setrlimit(resource.RLIMIT_NOFILE, (hard_nofile, hard_nofile))
except (ValueError, OSError):
_logger.warning("Failed to retrieve and set the max opened files limit")
else:
_logger.debug("Set max opened files to %d", hard_nofile)