Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

optimize redis import

harry740960b0ffab
diff --git a/app/services/state.py b/app/services/state.py
index 1bb32e03..b7501656 100644
--- a/app/services/state.py
+++ b/app/services/state.py
@@ -1,7 +1,5 @@
import ast
-import json
from abc import ABC, abstractmethod
-import redis
from app.config import config
from app.models import const
@@ -47,6 +45,7 @@ class MemoryState(BaseState):
class RedisState(BaseState):
def __init__(self, host='localhost', port=6379, db=0):
+ import redis
self._redis = redis.StrictRedis(host=host, port=port, db=db)
def update_task(self, task_id: str, state: int = const.TASK_STATE_PROCESSING, progress: int = 0, **kwargs):