Skip to content

Commit 1ba8c69

Browse files
committed
🐞 fix: 重试连接提示
1 parent fa75be0 commit 1ba8c69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "usepy-plugin-redis"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = ""
55
authors = ["miclon <jcnd@163.com>"]
66
readme = "README.md"

src/usepy_plugin_redis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def _create_connection(self):
3636
while attempts <= MAX_CONNECTION_ATTEMPTS:
3737
try:
3838
connector = redis.Redis(**self.parameters)
39+
connector.ping()
3940
if attempts > 1:
4041
logger.warning(f"RedisStore connection succeeded after {attempts} attempts", )
41-
connector.ping()
4242
return connector
4343
except redis.ConnectionError as exc:
4444
logger.warning(f"RedisStore connection error<{exc}>; retrying in {delay} seconds")

0 commit comments

Comments
 (0)