aggregations.py 文件源码

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

项目:invenio-stats 作者: inveniosoftware 项目源码 文件源码
def _get_oldest_event_timestamp(self):
        """Search for the oldest event timestamp."""
        # Retrieve the oldest event in order to start aggregation
        # from there
        query_events = Search(
            using=self.client,
            index=self.event_index
        )[0:1].sort(
            {'timestamp': {'order': 'asc'}}
        )
        result = query_events.execute()
        # There might not be any events yet if the first event have been
        # indexed but the indices have not been refreshed yet.
        if len(result) == 0:
            return None
        return parser.parse(result[0]['timestamp'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号