Skip to content

Commit 3e8ceab

Browse files
committed
Format
1 parent 856f319 commit 3e8ceab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ async def _():
122122
多命令共享使用统计集合。
123123
注:请确保使用相同使用统计集合的限制器限流参数一致(限制对象,限制时间,最大使用量),否则可能会有预期之外的行为。
124124
```python
125-
# 注意,不同限流算法下的使用情况集合无法共享
125+
# 注意,不同限流算法下的使用统计集合无法共享
126126
cmd1 = on_startswith("cmd1")
127127
@cmd1.handle(parameterless=[
128128
Cooldown(UserScope(), 100, limit = 2, reject="reject1", name="share_set")

nonebot_plugin_limiter/persist.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def load_usage_data() -> None:
5858
_SlidingWindowCooldownDict[name] = {}
5959
bucket = _SlidingWindowCooldownDict[name]
6060
for _id, usage in usage_set.items():
61-
bucket[_id] = SlidingWindowUsage(timestamps=deque(datetime.fromtimestamp(t, tz=_tz) for t in usage.timestamps))
61+
bucket[_id] = SlidingWindowUsage(
62+
timestamps=deque(datetime.fromtimestamp(t, tz=_tz) for t in usage.timestamps)
63+
)
6264

6365
logger.info("Loaded previous usage data.")
6466

0 commit comments

Comments
 (0)