️ 减少插件限制查询次数 (#1743)

This commit is contained in:
HibiKier 2024-11-26 19:29:32 +08:00 committed by GitHub
parent 9449316a14
commit 6e740657b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,7 @@ class LimitManage:
if group_id and limit.watch_type == LimitWatchType.GROUP: if group_id and limit.watch_type == LimitWatchType.GROUP:
key_type = channel_id or group_id key_type = channel_id or group_id
logger.debug( logger.debug(
f"解除对象: {key_type} 的block现在", f"解除对象: {key_type} 的block限制",
"AuthChecker", "AuthChecker",
session=user_id, session=user_id,
group_id=group_id, group_id=group_id,
@ -323,6 +323,7 @@ class AuthChecker:
if not group_id: if not group_id:
group_id = channel_id group_id = channel_id
channel_id = None channel_id = None
if plugin.module not in LimitManage.add_module:
limit_list: list[PluginLimit] = await plugin.plugin_limit.filter( limit_list: list[PluginLimit] = await plugin.plugin_limit.filter(
status=True status=True
).all() # type: ignore ).all() # type: ignore