mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
perf: 敏感词迁移的双条件检查
This commit is contained in:
parent
835275b47f
commit
2c3399e237
|
@ -14,7 +14,7 @@ class SensitiveWordMigration(migration.Migration):
|
|||
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):
|
||||
"""执行迁移
|
||||
|
|
Loading…
Reference in New Issue
Block a user