def _flush(store: typing.Callable, ns_keys: str): """Flushes data from cache. """ CHUNK_SIZE = 1000 cursor = '0' while cursor != 0: cursor, keys = store.scan(cursor=cursor, match=ns_keys, count=CHUNK_SIZE) if keys: store.delete(*keys)
def _delete_many(store: typing.Callable, search_key: SearchKey): """Deletes items under matching keys. """ chunk_size = 1000 cursor = '0' while cursor != 0: cursor, keys = store.scan(cursor=cursor, match=search_key.key, count=chunk_size) if keys: store.delete(*keys)
def _delete_one(store: typing.Callable, item_key: ItemKey): """Deletes item under exactly matched key. """ store.delete(item_key.key)
def _delete(store: typing.Callable, key: str): """Wraps redis.delete command. """ store.delete(key)