updater.py 文件源码

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

项目:feedlark 作者: CPSSD 项目源码 文件源码
def update_user_data(username, updates):
    """
    Update the data for the given user in the database,
    with the given dict of updates
    """
    req_data = bson.BSON.encode({
        "key": key,
        "database": "feedlark",
        "collection": "user",
        "data": {
            "selector": {
                "username": username,
                },
            "updates": updates,
            },
        })
    update_rsp = gearman_client.submit_job('db-update', str(req_data))
    result = bson.BSON(update_rsp.result).decode()
    if result[u"status"] != u"ok":
        log(2, "Error updating user data: " + str(result))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号