[FIX] fatal error when trying to enable logrotate

4e5119c6e5 didn't account for
`tools.config['workers']` being `None` on windows, resulting in the
entire thing crashing when trying to execute `None > 1` in Python 3.

Fixes #26447
This commit is contained in:
Magnus
2018-08-30 16:20:10 +02:00
committed by xmo-odoo
parent 0fd5c70940
commit 4877030d64
+1 -1
View File
@@ -119,7 +119,7 @@ def init_logger():
if dirname and not os.path.isdir(dirname):
os.makedirs(dirname)
if tools.config['logrotate'] is not False:
if tools.config['workers'] > 1:
if tools.config['workers'] and tools.config['workers'] > 1:
# TODO: fallback to regular file logging in master for safe(r) defaults?
#
# Doing so here would be a good idea but also might break