DB.py 文件源码

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

项目:mongodb_consistent_backup 作者: Percona-Lab 项目源码 文件源码
def get_oplog_cursor_since(self, caller, ts=None):
        frame   = getframeinfo(currentframe().f_back)
        comment = "%s:%s;%s:%i" % (caller.__name__, frame.function, frame.filename, frame.lineno)
        if not ts:
            ts = self.get_oplog_tail_ts()
        query = {'ts': {'$gte': ts}}
        logging.debug("Querying oplog on %s with query: %s" % (self.uri, query))
        # http://api.mongodb.com/python/current/examples/tailable.html
        return self.get_oplog_rs().find(query, cursor_type=CursorType.TAILABLE_AWAIT, oplog_replay=True).comment(comment)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号