def get_waiting_tasks(self, concurrency_key):
"""
Returns list of waiting tasks with the specified concurrency key
:param concurrency_key: concurrency key of the tasks
:return: concurrency_key: list of waiting tasks
"""
args = {
"IndexName": "WaitForExecutionTasks",
"Select": "ALL_ATTRIBUTES",
"KeyConditionExpression": Key(TASK_TR_CONCURRENCY_ID).eq(concurrency_key),
"FilterExpression": Attr(TASK_TR_STATUS).eq(STATUS_WAITING)
}
waiting_list = []
while True:
resp = self._action_table.query_with_retries(**args)
waiting_list += resp.get("Items", [])
last = resp.get("LastEvaluatedKey")
if last is not None:
args["ExclusiveStartKey"] = last
else:
break
return waiting_list
评论列表
文章目录