Skip to content

Commit 48e0971

Browse files
authored
fix: Manage redis pipe's context (feast-dev#3655)
Signed-off-by: Jiwon Park <bakjeeone@hotmail.com>
1 parent 4861af0 commit 48e0971

File tree

1 file changed

+7
-7
lines changed
  • sdk/python/feast/infra/online_stores

1 file changed

+7
-7
lines changed

sdk/python/feast/infra/online_stores/redis.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ class RedisOnlineStore(OnlineStore):
8989
def delete_entity_values(self, config: RepoConfig, join_keys: List[str]):
9090
client = self._get_client(config.online_store)
9191
deleted_count = 0
92-
pipeline = client.pipeline(transaction=False)
9392
prefix = _redis_key_prefix(join_keys)
9493

95-
for _k in client.scan_iter(
96-
b"".join([prefix, b"*", config.project.encode("utf8")])
97-
):
98-
pipeline.delete(_k)
99-
deleted_count += 1
100-
pipeline.execute()
94+
with client.pipeline(transaction=False) as pipe:
95+
for _k in client.scan_iter(
96+
b"".join([prefix, b"*", config.project.encode("utf8")])
97+
):
98+
pipe.delete(_k)
99+
deleted_count += 1
100+
pipe.execute()
101101

102102
logger.debug(f"Deleted {deleted_count} rows for entity {', '.join(join_keys)}")
103103

0 commit comments

Comments
 (0)