示例#1
0
文件: base.py 项目: cash2one/bmp
    def add_job(self, job, args=None, date=None, _id=None):
        run_date = datetime.now()
        if date: run_date = date
        if not _id:
            _id = "%s" % (uuid1())

        minutes = 1

        sched.add_job(_wrap_job,
                      "date",
                      id=_id,
                      run_date=run_date,
                      misfire_grace_time=60 * 60 * 24 * 365 * 100,
                      args=(_id, args, job, minutes),
                      replace_existing=True)

        if not sched.running:
            sched.start()
示例#2
0
文件: base.py 项目: xutaoding/bmp
    def add_job(self, job, args=None, date=None, _id=None):
        run_date = datetime.now()
        if date: run_date = date
        if not _id:
            _id = "%s" % (uuid1())

        minutes = 1

        sched.add_job(_wrap_job,
                      "date",
                      id=_id,
                      run_date=run_date,
                      misfire_grace_time=60 * 60 * 24 * 365 * 100,
                      args=(_id, args, job, minutes),
                      replace_existing=True)

        if not sched.running:
            sched.start()
示例#3
0
文件: base.py 项目: cash2one/bmp
 def remove_job(self, _id):
     if not sched.running:
         sched.start()
     sched.remove_job(_id)
示例#4
0
文件: base.py 项目: xutaoding/bmp
 def remove_job(self,_id):
     if not sched.running:
         sched.start()
     sched.remove_job(_id)