mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-11-12 08:56:34 -05:00
By default set soft limit to hard limit
This commit is contained in:
parent
939273c4b0
commit
7c56210f20
2 changed files with 11 additions and 7 deletions
|
|
@ -273,7 +273,12 @@ def get_version_string():
|
|||
def change_resource_limit(soft_file_no):
|
||||
try:
|
||||
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||
|
||||
if not soft_file_no:
|
||||
soft_file_no = hard
|
||||
|
||||
resource.setrlimit(resource.RLIMIT_NOFILE, (soft_file_no, hard))
|
||||
|
||||
logger.info("Set file limit to: %d", soft_file_no)
|
||||
except (ValueError, resource.error) as e:
|
||||
logger.warn("Failed to set file limit: %s", e)
|
||||
|
|
@ -372,8 +377,7 @@ def setup():
|
|||
|
||||
def run(config):
|
||||
with LoggingContext("run"):
|
||||
if config.soft_file_limit:
|
||||
change_resource_limit(config.soft_file_limit)
|
||||
change_resource_limit(config.soft_file_limit)
|
||||
|
||||
reactor.run()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue