diff --git a/ahserver/auth_api.py b/ahserver/auth_api.py index 8a042e8..29bcf8d 100644 --- a/ahserver/auth_api.py +++ b/ahserver/auth_api.py @@ -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() diff --git a/ahserver/hotreload.py b/ahserver/hotreload.py index b57236d..8b04edf 100644 --- a/ahserver/hotreload.py +++ b/ahserver/hotreload.py @@ -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