Merge remote-tracking branch 'upstream/main-fix' into refactor
This commit is contained in:
@@ -10,7 +10,7 @@ from PIL import Image
|
||||
import io
|
||||
|
||||
from ...common.database import db
|
||||
from ..chat.config import global_config
|
||||
from ..config.config import global_config
|
||||
from ..chat.utils import get_embedding
|
||||
from ..chat.utils_image import ImageManager, image_path_to_base64
|
||||
from ..models.utils_model import LLM_request
|
||||
@@ -338,12 +338,12 @@ class EmojiManager:
|
||||
except Exception:
|
||||
logger.exception("[错误] 扫描表情包失败")
|
||||
|
||||
async def _periodic_scan(self, interval_MINS: int = 10):
|
||||
async def _periodic_scan(self):
|
||||
"""定期扫描新表情包"""
|
||||
while True:
|
||||
logger.info("[扫描] 开始扫描新表情包...")
|
||||
await self.scan_new_emojis()
|
||||
await asyncio.sleep(interval_MINS * 60) # 每600秒扫描一次
|
||||
await asyncio.sleep(global_config.EMOJI_CHECK_INTERVAL * 60)
|
||||
|
||||
def check_emoji_file_integrity(self):
|
||||
"""检查表情包文件完整性
|
||||
@@ -416,10 +416,10 @@ class EmojiManager:
|
||||
logger.error(f"[错误] 检查表情包完整性失败: {str(e)}")
|
||||
logger.error(traceback.format_exc())
|
||||
|
||||
async def start_periodic_check(self, interval_MINS: int = 120):
|
||||
async def start_periodic_check(self):
|
||||
while True:
|
||||
self.check_emoji_file_integrity()
|
||||
await asyncio.sleep(interval_MINS * 60)
|
||||
await asyncio.sleep(global_config.EMOJI_CHECK_INTERVAL * 60)
|
||||
|
||||
|
||||
# 创建全局单例
|
||||
|
||||
Reference in New Issue
Block a user