示例#1
0
def start_tgscheduler():
    import tgscheduler
    tgscheduler.start_scheduler()
    tgscheduler.add_interval_task(action=update_stocks,
                                  taskname="test1",
                                  interval=5,
                                  initialdelay=2)
示例#2
0
 def __init__(self):
     tgscheduler.start_scheduler()
     self.threadid = 1
     self.mythread = myThread(1, "Thread-" + str(self.threadid), 1)
     tgscheduler.add_interval_task(action=self.printTask,
                                   taskname="test1",
                                   interval=5,
                                   initialdelay=2)
     self.mythread.showThread()
示例#3
0
    def __init__(self):
        """Start the scheduler."""

        tgscheduler.start_scheduler()

        tgscheduler.add_interval_task(action=manager_check, taskname="Manager check", interval=20, initialdelay=1)

        #      from astportal2.controllers.websocket import update
        #      tgscheduler.add_interval_task(action=update,
        #         taskname='WebSocket ping', interval=1, initialdelay=10)

        from astportal2.controllers.callback import do

        tgscheduler.add_interval_task(action=do, taskname="Callback do", interval=13, initialdelay=30)
示例#4
0
   def __init__(self):
      """Start the scheduler."""

      tgscheduler.start_scheduler()

      tgscheduler.add_interval_task(action=manager_check,
         taskname='Manager check', interval=20, initialdelay=1)

#      from astportal2.controllers.websocket import update
#      tgscheduler.add_interval_task(action=update,
#         taskname='WebSocket ping', interval=1, initialdelay=10)

      from astportal2.controllers.callback import do
      tgscheduler.add_interval_task(action=do, 
         taskname='Callback do', interval=13, initialdelay=7)

#      from astportal2.controllers.grandstream import do
#      tgscheduler.add_interval_task(action=do, 
#         taskname='GXP action do', interval=3, initialdelay=17)

      from astportal2.lib.grandstream import do_gxp_actions
      tgscheduler.add_interval_task(action=do_gxp_actions, 
         taskname='GXP actions', interval=3, initialdelay=11)
 def __init__(self):
     tgscheduler.start_scheduler()
     self.threadid = 1
     self.mythread = myThread(1, "Thread-"+str(self.threadid), 1)
     tgscheduler.add_interval_task( action= self.printTask, taskname="test1" , interval=5, initialdelay=2)
     self.mythread.showThread()
示例#6
0
 def test_interval_task(self):
     """Test adding an interval task."""
     task = add_interval_task(functest, 60*10, taskname='intervaltest')
     self.assertEqual(task.action, functest)
     self.assertEqual(task.name, 'intervaltest')
示例#7
0
def start_task():
    tgscheduler.start_scheduler()
    mailScheduler = MailScheduler()
    tgscheduler.add_interval_task( action= mailScheduler.printTask, taskname="test1" , interval=5, initialdelay=20)
def start_task():
    tgscheduler.start_scheduler()
    mailScheduler = MailScheduler()
    tgscheduler.add_interval_task( action= mailScheduler.printTask, taskname="test1" , interval=5, initialdelay=20)