2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

wafcache: fix reporting of concurrent trim error

As this is run in the non-waf process we don't have Logs, so we
write to stderr instead or we will get a NameError name 'Logs' is
not defined.
This commit is contained in:
Federico Pellegrin 2021-01-11 11:18:48 +01:00 committed by Thomas Nagy
parent 236e6a7945
commit a8469f49d8

View File

@ -400,8 +400,8 @@ def lru_evict():
try:
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
except EnvironmentError:
if Logs.verbose:
Logs.debug('wafcache: another cleaning process is running')
if WAFCACHE_VERBOSITY:
sys.stderr.write('wafcache: another cleaning process is running\n')
else:
# now dow the actual cleanup
lru_trim()