MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / get_task_data

Function get_task_data

app/deploy/jockey/worker/queue.py:203–230  ·  view source on GitHub ↗

Get task data by task ID. Args: task_id: Task identifier Returns: Task data dictionary or None if not found

(task_id: str)

Source from the content-addressed store, hash-verified

201
202
203def get_task_data(task_id: str) -> Optional[JobData]:
204 """Get task data by task ID.
205
206 Args:
207 task_id: Task identifier
208
209 Returns:
210 Task data dictionary or None if not found
211 """
212 cursor = 0
213
214 while True:
215 cursor, fields = _get_redis_client().hscan(
216 TASKS_HASH_NAME,
217 cursor,
218 match=f"*:*:{task_id}",
219 )
220
221 for _, task_data in fields.items():
222 try:
223 return JobData(**json.loads(task_data))
224 except (json.JSONDecodeError, KeyError, TypeError):
225 continue
226
227 if cursor == 0:
228 break
229
230 return None
231
232
233def get_queue_length() -> int:

Calls 2

_get_redis_clientFunction · 0.85
JobDataClass · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…