Exemplo n.º 1
0
    def test_start_timed_tasks_for_running_plans1(self):

        # Start 4 plans
        orchestrator.execute_plan(self.plan1_id)
        orchestrator.execute_plan(self.plan2_id)
        orchestrator.execute_plan(self.plan3_id)
        orchestrator.execute_plan(self.plan4_id)

        # Set datetime
        timer_svc.set_datetime("2015-11-12T11:23:44.123Z")

        with patch("orch.orchestrator.execute_task") as mock_execute_task:
            sched_svc.start_timed_tasks_for_running_plans()

        self.assertEqual(mock_execute_task.call_count, 3)
Exemplo n.º 2
0
def start_timed_plans():
    for plan_id in plan_repo.get_not_started_timed_plan_ids():
        plan = plan_repo.get_plan_by_id(plan_id)
        if timer_svc.is_current_datetime_later_than( plan.get_start_on() ):
            # TODO Add task_starter and task_listener
            orchestrator.execute_plan(plan_id)
Exemplo n.º 3
0
def start_timed_plans():
    for plan_id in plan_repo.get_not_started_timed_plan_ids():
        plan = plan_repo.get_plan_by_id(plan_id)
        if timer_svc.is_current_datetime_later_than(plan.get_start_on()):
            # TODO Add task_starter and task_listener
            orchestrator.execute_plan(plan_id)