2010-12-28 16 views
17

के माध्यम से djcelery के celeryd डीबगिंग किसी ने पीडीबी का उपयोग कर celeryd कार्यकर्ता डीबगिंग करने की कोशिश की है?पीडीबी

Error while handling action event. 
Traceback (most recent call last): 
    File "/home/jeeyo/workspace3/uwcr/subscriptions/tasks.py", line 79, in process_action_event 
    func(action_event) 
    File "/home/jeeyo/workspace3/uwcr/subscriptions/tasks.py", line 36, in new_user_email 
    send_registration_email(username, new_user.get_profile().plaintext_password) 
    File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 18, in send_registration_email 
    'Your password from UWCoopRankings', user 
    File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 61, in send_email 
    if isinstance(to, basestring): 
    File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 61, in send_email 
    if isinstance(to, basestring): 
    File "/usr/lib/python2.6/bdb.py", line 46, in trace_dispatch 
    return self.dispatch_line(frame) 
    File "/usr/lib/python2.6/bdb.py", line 65, in dispatch_line 
    if self.quitting: raise BdbQuit 
BdbQuit 

इस के लिए कोई समाधान: जब भी कोई ब्रेकप्वाइंट का सामना करना पड़ा है (या तो pdb के माध्यम से celeryd चलाकर, या pdb.set_trace() द्वारा), मैं निम्न त्रुटि मारा?

उत्तर

14

मुझे एक ही समस्या थी। बजाय अजवाइन के दूरस्थ डीबगर rdb उपयोग करके देखें:

from celery import task 
from celery.contrib import rdb 

@task() 
def add(x, y): 
    result = x + y 
    rdb.set_trace() # <- set break-point 
    return result 

user guide (लिंक अद्यतन 2017/5) देखें।

+2

लिंक बदल गया है। http://docs.celeryproject.org/en/latest/tutorials/debugging.html –

+1

लिंक बदल गया है ... फिर से! http://docs.celeryproject.org/en/latest/userguide/debugging.html – nachopro

संबंधित मुद्दे