mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 04:40:00 +08:00
bugfix:更换数据库初始化超时路径以修复连接超时问题 (#2137)
* bugfix:更换数据库初始化超时路径以修复连接超时问题 * 移除部分观测链路 * 细节修改 * 权限检查细节修改2 * bugfix:修复金币懒加载造成插件金币消耗不了的问题 * bugfix:整理鉴权逻辑 * 完善缓存系统 * 优化官端使用 * bugfix:增加官机和频道的前导统一剥离,新增获取群列表自愈 * bugfix:修复导入问题
This commit is contained in:
@@ -2,11 +2,13 @@ from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from zhenxun.services.cache.runtime_cache import (
|
||||
PluginLimitMemoryCache,
|
||||
from zhenxun.utils.enum import BlockType, PluginType
|
||||
|
||||
from .auth.data_provider import (
|
||||
DEFAULT_PERMISSION_DATA_PROVIDER,
|
||||
PermissionDataProvider,
|
||||
PluginLimitSnapshot,
|
||||
)
|
||||
from zhenxun.utils.enum import BlockType, PluginType
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
@@ -81,6 +83,7 @@ async def get_plugin_auth_profile(
|
||||
*,
|
||||
event_cache: dict | None = None,
|
||||
allow_cache_load: bool = True,
|
||||
provider: PermissionDataProvider = DEFAULT_PERMISSION_DATA_PROVIDER,
|
||||
) -> PluginAuthProfile:
|
||||
module = str(getattr(plugin, "module", "") or "")
|
||||
profile_cache: dict[str, PluginAuthProfile] = {}
|
||||
@@ -98,10 +101,10 @@ async def get_plugin_auth_profile(
|
||||
limits = limit_cache[module]
|
||||
limits_ready = True
|
||||
if limits is None:
|
||||
limits = PluginLimitMemoryCache.get_limits_if_ready(module)
|
||||
limits = provider.get_module_limits_if_ready(module)
|
||||
limits_ready = limits is not None
|
||||
if limits is None and allow_cache_load:
|
||||
limits = await PluginLimitMemoryCache.get_limits(module)
|
||||
limits = await provider.get_module_limits(module)
|
||||
limits_ready = True
|
||||
if limits is None:
|
||||
limits = []
|
||||
|
||||
Reference in New Issue
Block a user