task_tracking_table.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:aws-ops-automator 作者: awslabs 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号