天天看点

celery trying again

response = push.send()
Request failed with status : '1011 {'code': 1011, 'message': 'cannot find user by this audience'}': "cannot find user by this audience"

import jpush
_jpush = jpush.JPush('38445dcca2aaf44a9ce7bd4b', '0477f04bbfd8d97c04a9208c') # dev
_jpush = jpush.JPush('fd2370dacc7c25531ed9c55a', '66c6f36049b92664c65520e6') # pro
push = _jpush.create_push()
alias_list = ['39576fb3d5ed72ffb370f521ca93e890']
push.audience = jpush.audience(jpush.alias(*alias_list))

alert = 'test001'
data = {"uri": "", "page": , 
        "params": {"duration": , 
            "text": {"desc": "这就是一条描述", "title": "标题", 
                "coupons": {"expireAt": "2018-05-29", "status": , "ccontrolNo": "F849BF801FD8", "couponType": , "price": , "redeemCode": "397301100098", "id": , "name": "名字", "description": "另一个描述 description", "detail": "详情1,2,3,4"}
            }, 
        "record_id": }, 
        "redbadge": {"100": }}
sound = 'default'
ios_production = True
push.notification = jpush.notification(
    alert=alert, ios={"extras": {"data": data}, "sound": sound, "content-available": True,})
push.options = {"apns_production": ios_production}
push.platform = jpush.all
response = push.send()
print('response: %s' % response.payload)



b98f9b9d7fb0ec1e65f54:fb3d5ed72ffb370f521ca93e89




测试
Sroadcast.send_msg_to_user('586b87213a09807014c1ac83', message='test')

celery worker -A -l info --beat 


celery.worker.consumer  

consumer: Cannot connect to redis://.:/: .
Trying again in  seconds...
           

日志等级

http://www.jianshu.com/p/9e422d9f1ce2

继续阅读