refactor: fix basedpyright/ruff errors

This commit is contained in:
Stream
2025-09-22 15:17:19 +08:00
parent e9313b9c1b
commit 394b7d09b8
11 changed files with 37 additions and 24 deletions

View File

@ -32,6 +32,7 @@ from services.workflow_service import WorkflowService
logger = logging.getLogger(__name__)
class ChatflowMemoryService:
@staticmethod
def get_persistent_memories(
@ -186,9 +187,9 @@ class ChatflowMemoryService:
ChatflowMemoryVariable.memory_id == spec.id,
ChatflowMemoryVariable.tenant_id == tenant_id,
ChatflowMemoryVariable.app_id == app_id,
ChatflowMemoryVariable.node_id == \
ChatflowMemoryVariable.node_id ==
(node_id if spec.scope == MemoryScope.NODE else None),
ChatflowMemoryVariable.conversation_id == \
ChatflowMemoryVariable.conversation_id ==
(conversation_id if spec.term == MemoryTerm.SESSION else None),
)
).order_by(ChatflowMemoryVariable.version.desc()).limit(1)
@ -517,6 +518,7 @@ class ChatflowMemoryService:
result.append((str(message.role.value), message.get_text_content()))
return result
def _get_memory_sync_lock_key(app_id: str, conversation_id: str) -> str:
"""Generate Redis lock key for memory sync updates