Skip to content

Commit

Permalink
perf: 敏感词迁移的双条件检查
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Mar 23, 2024
1 parent 835275b commit 2c3399e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/migrations/m001_sensitive_word_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""执行迁移
Expand Down

0 comments on commit 2c3399e

Please sign in to comment.