commit
e4e678f80b
3 changed files with 16 additions and 0 deletions
|
|
@ -50,3 +50,6 @@ class JsonKVStorage(BaseKVStorage):
|
|||
for doc_id in ids:
|
||||
self._data.pop(doc_id, None)
|
||||
await self.index_done_callback()
|
||||
|
||||
async def drop(self) -> None:
|
||||
self._data = {}
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@ class MongoKVStorage(BaseKVStorage):
|
|||
# Mongo handles persistence automatically
|
||||
pass
|
||||
|
||||
async def drop(self) -> None:
|
||||
"""Drop the collection"""
|
||||
await self._data.drop()
|
||||
|
||||
|
||||
@final
|
||||
@dataclass
|
||||
|
|
@ -198,6 +202,10 @@ class MongoDocStatusStorage(DocStatusStorage):
|
|||
# Mongo handles persistence automatically
|
||||
pass
|
||||
|
||||
async def drop(self) -> None:
|
||||
"""Drop the collection"""
|
||||
await self._data.drop()
|
||||
|
||||
|
||||
@final
|
||||
@dataclass
|
||||
|
|
|
|||
|
|
@ -61,3 +61,8 @@ class RedisKVStorage(BaseKVStorage):
|
|||
async def index_done_callback(self) -> None:
|
||||
# Redis handles persistence automatically
|
||||
pass
|
||||
|
||||
async def drop(self) -> None:
|
||||
keys = await self._redis.keys(f"{self.namespace}:*")
|
||||
if keys:
|
||||
await self._redis.delete(*keys)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue