mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-03 02:30:01 +08:00
将配置替换加入单次定时任务,提高启动速度
This commit is contained in:
@@ -238,14 +238,14 @@ class WordBank(db.Model):
|
||||
return query.where(cls.problem == problem)
|
||||
# 正则匹配
|
||||
if await db.first(
|
||||
db.text(sql_text + f" and word_type = 2 and '{problem}' ~ problem;")
|
||||
db.text(sql_text + f" and word_type = 2 and word_scope != 999 and '{problem}' ~ problem;")
|
||||
):
|
||||
return sql_text + f" and word_type = 2 and '{problem}' ~ problem;"
|
||||
return sql_text + f" and word_type = 2 and word_scope != 999 and '{problem}' ~ problem;"
|
||||
# 模糊匹配
|
||||
if await db.first(
|
||||
db.text(sql_text + f" and word_type = 1 and '{problem}' ~ problem;")
|
||||
db.text(sql_text + f" and word_type = 1 and word_scope != 999 and '{problem}' ~ problem;")
|
||||
):
|
||||
return sql_text + f" and word_type = 1 and '{problem}' ~ problem;"
|
||||
return sql_text + f" and word_type = 1 and word_scope != 999 and '{problem}' ~ problem;"
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user