Created
March 1, 2018 10:06
-
-
Save cenphoenix/57d8ef64d0c3e6be9399292bdde3f6da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@celery_app.task | |
def send_phone_code(user_id, verify_token, phone_number): | |
customer = Customer.objects.get(id=user_id) | |
#发送短信 | |
send_message(...) | |
try: | |
# 通知任务完成 | |
Group('phone_verify-%s' % customer.username).send({ | |
'text': json.dumps({ | |
'success': True, | |
'msg': 'new message sent' | |
}) | |
}) | |
except Exception as e: | |
# # 通知任务失败 | |
Group('phone_verify-%s' % customer.username).send({ | |
'text': json.dumps({ | |
'success': False, | |
'msg': e.msg | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment