mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
add clear method
This commit is contained in:
@@ -50,3 +50,8 @@ class FastAPICache:
|
||||
@classmethod
|
||||
def get_key_builder(cls):
|
||||
return cls._key_builder
|
||||
|
||||
@classmethod
|
||||
async def clear(cls, namespace: str = None, key: str = None):
|
||||
namespace = cls._prefix + ":" + namespace if namespace else None
|
||||
return await cls._backend.clear(namespace, key)
|
||||
|
||||
Reference in New Issue
Block a user