d
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
from app.core.db import get_db
|
||||
from app.core.redis_client import get_redis
|
||||
|
||||
|
||||
def get_sensitive_words_payload() -> dict:
|
||||
@@ -54,6 +57,13 @@ def save_sensitive_words_payload(payload: dict) -> dict:
|
||||
)
|
||||
conn.commit()
|
||||
|
||||
try:
|
||||
redis_client = get_redis()
|
||||
redis_client.set("domain_tool:sensitive_words", json.dumps(words, ensure_ascii=False))
|
||||
redis_client.publish("domain_tool:config_update", "sensitive_words")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return {
|
||||
"total": len(words),
|
||||
"text": "\n".join(words),
|
||||
|
||||
Reference in New Issue
Block a user