mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-22 20:36:08 +00:00
perf: 敏感词迁移的双条件检查
This commit is contained in:
@@ -14,7 +14,7 @@ class SensitiveWordMigration(migration.Migration):
|
|||||||
async def need_migrate(self) -> bool:
|
async def need_migrate(self) -> bool:
|
||||||
"""判断当前环境是否需要运行此迁移
|
"""判断当前环境是否需要运行此迁移
|
||||||
"""
|
"""
|
||||||
return os.path.exists("data/config/sensitive-words.json")
|
return os.path.exists("data/config/sensitive-words.json") and not os.path.exists("data/metadata/sensitive-words.json")
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
"""执行迁移
|
"""执行迁移
|
||||||
|
|||||||
Reference in New Issue
Block a user