Clean up the remaining uses of print()
This commit is contained in:
@@ -183,9 +183,9 @@ async def refresh_wwwroot():
|
|||||||
for name in sorted(set(wwwold) - set(www)):
|
for name in sorted(set(wwwold) - set(www)):
|
||||||
changes += f"Deleted /{name}\n"
|
changes += f"Deleted /{name}\n"
|
||||||
if changes:
|
if changes:
|
||||||
print(f"Updated wwwroot:\n{changes}", end="", flush=True)
|
logger.info(f"Updated wwwroot:\n{changes}", end="", flush=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error loading wwwroot: {e!r}")
|
logger.error(f"Error loading wwwroot: {e!r}")
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from time import monotonic
|
from time import monotonic
|
||||||
|
from typing import Callable
|
||||||
|
|
||||||
|
|
||||||
class LRUCache:
|
class LRUCache:
|
||||||
@@ -12,7 +13,7 @@ class LRUCache:
|
|||||||
cache (list): Internal list storing the cache items.
|
cache (list): Internal list storing the cache items.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, open: callable, *, capacity: int, maxage: float):
|
def __init__(self, open: Callable, *, capacity: int, maxage: float):
|
||||||
"""
|
"""
|
||||||
Initialize LRUCache.
|
Initialize LRUCache.
|
||||||
|
|
||||||
@@ -50,7 +51,6 @@ class LRUCache:
|
|||||||
# Add/restore to end of cache
|
# Add/restore to end of cache
|
||||||
self.cache.insert(0, (key, f, monotonic()))
|
self.cache.insert(0, (key, f, monotonic()))
|
||||||
self.expire_items()
|
self.expire_items()
|
||||||
print(self.cache)
|
|
||||||
return f
|
return f
|
||||||
|
|
||||||
def expire_items(self):
|
def expire_items(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user