Skip to content

Commit

Permalink
change limiter to int in set_tat
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed May 7, 2024
1 parent 39bf145 commit 6fc198e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlette_plus/limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def get_tat(self, key: str, /) -> datetime.datetime:

async def set_tat(self, key: str, /, *, tat: datetime.datetime, limit: RateLimit) -> None:
if self.redis:
await self.redis.pool.set(key, tat.isoformat(), ex=limit.period.total_seconds() + 60) # type: ignore
await self.redis.pool.set(key, tat.isoformat(), ex=int(limit.period.total_seconds() + 60)) # type: ignore
else:
self._keys[key] = {"tat": tat, "limit": limit}

Expand Down

0 comments on commit 6fc198e

Please sign in to comment.