Skip to content

Commit b339a00

Browse files
committed
Update last activity to prevent timeout during active polling
1 parent 536391f commit b339a00

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

examples/say-server/server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,15 @@ def poll_tts_audio(queue_id: str) -> list[types.TextContent]:
327327
queue_id: The queue ID from create_tts_queue
328328
"""
329329
import json
330+
import time
330331

331332
state = tts_queues.get(queue_id)
332333
if not state:
333334
return [types.TextContent(type="text", text='{"error": "Queue not found"}')]
334335

336+
# Update last activity to prevent timeout during active polling
337+
state.last_activity = time.time()
338+
335339
# Get new chunks (use sync approach since we can't await in tool)
336340
# The lock is async, so we need to be careful here
337341
# For simplicity, just grab what's available without locking

0 commit comments

Comments
 (0)