1.dprojmyrecrumentinterviewer asks.py
from celery.contrib import rdb import time logger = logging.getLogger(__name__) @shared_task def send_dingtalk_message(message): time.sleep(5) logger.info('----------------enter send_ding_talk----------------') rdb.set_trace() send(message) logger.info('----------------after send_ding_talk----------------') time.sleep(5) rdb.set_trace()
2.用telnet进入session (D:djangotestmyrecrument>celery -A myrecrument worker --loglevel=INFO -P eventlet)
3.常用的指令
pdb 是shell的开头 ->下一个准备执行的命令 p 变量 #输出变量 n 执行下一个指令
参考:https://docs.python.org/zh-cn/3/library/pdb.html
https://docs.python.org/3/library/pdb.html
https://zhuanlan.zhihu.com/p/143518599