app/soc/cron/job.py
changeset 2345 f78caf12f32d
parent 2247 64968b86b07c
child 2366 1a954e80d444
equal deleted inserted replaced
2344:621252e2cc18 2345:f78caf12f32d
    27 
    27 
    28 from google.appengine.ext import db
    28 from google.appengine.ext import db
    29 from google.appengine.runtime import DeadlineExceededError
    29 from google.appengine.runtime import DeadlineExceededError
    30 
    30 
    31 from soc.cron import student_proposal_mailer
    31 from soc.cron import student_proposal_mailer
       
    32 from soc.cron import unique_user_id_adder
    32 from soc.models.job import Job
    33 from soc.models.job import Job
       
    34 
    33 
    35 
    34 class Error(Exception):
    36 class Error(Exception):
    35   """Base class for all exceptions raised by this module.
    37   """Base class for all exceptions raised by this module.
    36   """
    38   """
    37   pass
    39   pass
    65     self.tasks = {}
    67     self.tasks = {}
    66     self.tasks['setupStudentProposalMailing'] = \
    68     self.tasks['setupStudentProposalMailing'] = \
    67         student_proposal_mailer.setupStudentProposalMailing
    69         student_proposal_mailer.setupStudentProposalMailing
    68     self.tasks['sendStudentProposalMail'] = \
    70     self.tasks['sendStudentProposalMail'] = \
    69         student_proposal_mailer.sendStudentProposalMail
    71         student_proposal_mailer.sendStudentProposalMail
       
    72     self.tasks['setupUniqueUserIdAdder'] = \
       
    73         unique_user_id_adder.setupUniqueUserIdAdder
       
    74     self.tasks['addUniqueUserIds'] = \
       
    75         unique_user_id_adder.addUniqueUserIds
    70 
    76 
    71   def claimJob(self, job_key):
    77   def claimJob(self, job_key):
    72     """A transaction to claim a job.
    78     """A transaction to claim a job.
    73 
    79 
    74     The transaction is rolled back if the status is not 'waiting'.
    80     The transaction is rolled back if the status is not 'waiting'.