mirror of
https://github.com/langgenius/dify.git
synced 2025-12-08 17:01:15 +00:00
Fix: correct has_more pagination logic in get_conversational_variable (#25484)
Signed-off-by: Yongtao Huang<yongtaoh2022@gmail.com>
This commit is contained in:
parent
c7868fb176
commit
a1322ddb5d
@ -222,8 +222,8 @@ class ConversationService:
|
|||||||
# Filter for variables created after the last_id
|
# Filter for variables created after the last_id
|
||||||
stmt = stmt.where(ConversationVariable.created_at > last_variable.created_at)
|
stmt = stmt.where(ConversationVariable.created_at > last_variable.created_at)
|
||||||
|
|
||||||
# Apply limit to query
|
# Apply limit to query: fetch one extra row to determine has_more
|
||||||
query_stmt = stmt.limit(limit) # Get one extra to check if there are more
|
query_stmt = stmt.limit(limit + 1)
|
||||||
rows = session.scalars(query_stmt).all()
|
rows = session.scalars(query_stmt).all()
|
||||||
|
|
||||||
has_more = False
|
has_more = False
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user