Exemplo n.º 1
0
class TimerTaskService(object):
    def __init__(self):
        self.timeScheduler = TimeScheduler()

    def addJob(self, name, id, func, second, hour, dayOfWeek):
        '''name:mysql服务,或者其他
           id:host+name (唯一性)
        '''
        self.timeScheduler.addJob(name, id, func, second, hour, dayOfWeek)

    def clean(self):
        '''删除所有的任务'''
        self.timeScheduler.clean()
Exemplo n.º 2
0
class TimerTaskService(object):
    def __init__(self):
        self.timeScheduler = TimeScheduler()

    def addJob(self, name, id, func, second, hour, dayOfWeek):
        '''name:mysql服务,或者其他
           id:host+name (唯一性)
        '''
        self.timeScheduler.addJob(name, id, func, second, hour, dayOfWeek)

    def clean(self):
        '''删除所有的任务'''
        self.timeScheduler.clean()
Exemplo n.º 3
0
 def __init__(self):
     self.dao = BichonDao()
     self.taskScheduler = TimeScheduler()
     servers = self.dao.selectServer()
     for server in servers:
         service = self.dao.selectService(server.id)
         Supervise.hostServicesMap.setdefault(server.host, service)
     self.initScheduler()
Exemplo n.º 4
0
#       ��� ���
#       ��� ���
#  ������湖状暖暖炙������
#  Module Desc:clover
#  User: z.mm | [email protected]
#  Date: 2016/1/5
#  Time: 12:00

from multiprocessing import Process
from datetime import datetime
import time

__author__ = "Administrator"


def tick():
    print("Tick! The time is: %s" % datetime.now())


from com.timeTask.TimeScheduler import TimeScheduler

a = TimeScheduler()
a.addJob(tick, "*/3", "*", "*", "task1")

while True:
    try:
        time.sleep(5)

    except (KeyboardInterrupt, WindowsError):
        print("xxx")
Exemplo n.º 5
0
 def __init__(self):
     self.timeScheduler = TimeScheduler()
Exemplo n.º 6
0
#       ��� ���
#       ��� ���
#  ������湖状暖暖炙������
#  Module Desc:clover
#  User: z.mm | [email protected]
#  Date: 2016/1/5
#  Time: 12:00

from multiprocessing import Process
from datetime import datetime
import time

__author__ = 'Administrator'


def tick():
    print('Tick! The time is: %s' % datetime.now())


from com.timeTask.TimeScheduler import TimeScheduler

a = TimeScheduler()
a.addJob(tick, "*/3", "*", "*", "task1")

while True:
    try:
        time.sleep(5)

    except (KeyboardInterrupt, WindowsError):
        print("xxx")
Exemplo n.º 7
0
 def __init__(self):
     self.timeScheduler = TimeScheduler()