Skip to content

Commit 7a6cf43

Browse files
committed
Fix formatting and mypy
1 parent 8a1071c commit 7a6cf43

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

template/{{package_name}}/app/controllers/ready.py.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ async def readiness_check() -> ReadyResponse:
5050
log.error("Could not connect to Redis")
5151
raise HTTPException(
5252
status_code=502,
53-
content=ErrorResponse(
54-
code=502, message="Could not connect to Redis"
55-
).dict(exclude_none=True),
53+
content=ErrorResponse(code=502, message="Could not connect to Redis").dict(
54+
exclude_none=True
55+
),
5656
)
5757
{% else %}
5858
if settings.USE_REDIS:

template/{{package_name}}/app/utils/{% if redis %}redis.py{% endif %}.jinja

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class RedisClient(object):
9999
return False
100100

101101
@classmethod
102-
async def set(cls, key, value) -> R:
102+
async def set(cls, key: str, value: str) -> R:
103103
"""Execute Redis SET command.
104104

105105
Set key to hold the string value. If key already holds a value, it is
@@ -152,9 +152,7 @@ class RedisClient(object):
152152
"""
153153
redis_client = cls.redis_client
154154

155-
cls.log.debug(
156-
f"Execute Redis RPUSH command, key: {key}, value: {value}"
157-
)
155+
cls.log.debug(f"Execute Redis RPUSH command, key: {key}, value: {value}")
158156
try:
159157
return await redis_client.rpush(key, value)
160158
except aioredis.RedisError as ex:
@@ -247,8 +245,7 @@ class RedisClient(object):
247245
"""
248246
redis_client = cls.redis_client
249247
cls.log.debug(
250-
f"Execute Redis LRANGE command, "
251-
f"key: {key}, start: {start}, end: {end}"
248+
f"Execute Redis LRANGE command, key: {key}, start: {start}, end: {end}"
252249
)
253250
try:
254251
return await redis_client.lrange(key, start, end)

0 commit comments

Comments
 (0)