Reduce noisy debug logs
- hotreload: only log signal file when mtime actually changes - auth_api: only log timecost for requests taking > 1 second
This commit is contained in:
parent
25db7851b1
commit
39c8cfed2d
@ -174,7 +174,8 @@ class AuthAPI:
|
||||
try:
|
||||
ret = await handler(request)
|
||||
t3 = time.time()
|
||||
debug(f'timecost=client({ip}) {user} access {path} cost {t3-t1}, ({t2-t1})')
|
||||
if t3 - t1 > 1.0:
|
||||
debug(f'timecost=client({ip}) {user} access {path} cost {t3-t1:.3f}, ({t2-t1:.3f})')
|
||||
return ret
|
||||
except Exception as e:
|
||||
t3 = time.time()
|
||||
|
||||
@ -110,10 +110,9 @@ class HotReloader:
|
||||
"""Check if cache invalidation signal file was updated."""
|
||||
try:
|
||||
mtime = os.path.getmtime(SIGNAL_FILE)
|
||||
debug(f'[hot_reload] signal file mtime: {mtime}, last: {self._last_signal_mtime}')
|
||||
if mtime > self._last_signal_mtime:
|
||||
self._last_signal_mtime = mtime
|
||||
debug('[hot_reload] signal file changed, triggering reload')
|
||||
debug(f'[hot_reload] signal file changed, mtime: {mtime}')
|
||||
return True
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user