Skip to content

Commit

Permalink
Merge branch 'main' into refactor/noop
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Nov 22, 2023
2 parents cd3f163 + f152376 commit b9c6156
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/Console/OpenFileDescriptorLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,16 @@ public static function bumpLimit(int $count, IO $io): Closure
);

return static function () use ($io, $softLimit, $hardLimit): void {
// TODO: this check looks redundant
if (function_exists('posix_setrlimit') && isset($softLimit, $hardLimit)) {
posix_setrlimit(
POSIX_RLIMIT_NOFILE,
$softLimit,
'unlimited' === $hardLimit ? POSIX_RLIMIT_INFINITY : $hardLimit,
);
posix_setrlimit(
POSIX_RLIMIT_NOFILE,
$softLimit,
'unlimited' === $hardLimit ? POSIX_RLIMIT_INFINITY : $hardLimit,
);

$io->writeln(
'<info>[debug] Restored the maximum number of open file descriptors</info>',
OutputInterface::VERBOSITY_DEBUG,
);
}
$io->writeln(
'<info>[debug] Restored the maximum number of open file descriptors</info>',
OutputInterface::VERBOSITY_DEBUG,
);
};
}
}

0 comments on commit b9c6156

Please sign in to comment.