1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-07-17 01:32:29 +02:00

Apply suggestions from code review

Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com>
This commit is contained in:
Florent Daigniere
2024-09-12 12:30:04 +02:00
committed by GitHub
parent c6c4c09f08
commit cdf8ee8820
2 changed files with 3 additions and 2 deletions

View File

@ -64,7 +64,7 @@ test_unsupported()
cmdline = [
"gunicorn",
"--threads", f"{os.environ.get('CPU_COUNT', 1)}",
"--threads", os.environ.get('CPU_COUNT', '1'),
# If SUBNET6 is defined, gunicorn must listen on IPv6 as well as IPv4
"-b", f"{'[::]' if os.environ.get('SUBNET6') else '0.0.0.0'}:8080",
"--logger-class mailu.Logger",

View File

@ -141,7 +141,8 @@ def clean_env():
for item in os.environ.get('TLS', ALL_PORTS).split(','):
if item in PORTS_REQUIRING_TLS:
os.environ[f'TLS_{item}']='True'
os.environ['CPU_COUNT'] = str(os.cpu_count())
if 'CPU_COUNT' not in os.environ:
os.environ['CPU_COUNT'] = str(os.cpu_count())
def drop_privs_to(username='mailu'):
pwnam = getpwnam(username)