示例#1
0
 def run_scheduler():
     scheduler = Scheduler(taskdb=get_taskdb(), projectdb=get_projectdb(),
                           newtask_queue=self.newtask_queue, status_queue=self.status_queue,
                           out_queue=self.scheduler2fetcher, data_path="./data/tests/",
                           resultdb=get_resultdb())
     scheduler.UPDATE_PROJECT_INTERVAL = 0.1
     scheduler.LOOP_INTERVAL = 0.1
     scheduler.INQUEUE_LIMIT = 10
     scheduler.DELETE_TIME = 0
     scheduler.DEFAULT_RETRY_DELAY = {'': 5}
     scheduler._last_tick = int(time.time())  # not dispatch cronjob
     run_in_thread(scheduler.xmlrpc_run, port=self.scheduler_xmlrpc_port)
     scheduler.run()
示例#2
0
 def run_scheduler():
     scheduler = Scheduler(taskdb=get_taskdb(), projectdb=get_projectdb(),
                           newtask_queue=self.newtask_queue, status_queue=self.status_queue,
                           out_queue=self.scheduler2fetcher, data_path="./data/tests/",
                           resultdb=get_resultdb())
     scheduler.UPDATE_PROJECT_INTERVAL = 0.1
     scheduler.LOOP_INTERVAL = 0.1
     scheduler.INQUEUE_LIMIT = 10
     scheduler.DELETE_TIME = 0
     scheduler.DEFAULT_RETRY_DELAY = {'': 5}
     scheduler._last_tick = int(time.time())  # not dispatch cronjob
     run_in_thread(scheduler.xmlrpc_run, port=self.scheduler_xmlrpc_port)
     scheduler.run()
示例#3
0
 def setUpClass(self):
     self.scheduler = Scheduler(taskdb=None,
                                projectdb=None,
                                newtask_queue=None,
                                status_queue=None,
                                out_queue=None)
     self.scheduler.PAUSE_TIME = 2
     self.project = Project(
         self.scheduler, {
             'name': 'test_project_not_started',
             'group': 'group',
             'status': 'RUNNING',
             'script': 'import time\nprint(time.time())',
             'comments': 'test project',
             'rate': 1.0,
             'burst': 10,
             'updatetime': time.time(),
         })