arthur/scheduler.py
def schedule_task(self, task_id):
        """Schedule a task.

        :param task_id: identifier of the task to schedule

        :raises NotFoundError: raised when the requested task is not
            found in the registry
        """
        task = self.registry.get(task_id)

        job_args = self._build_job_arguments(task)

        archiving_cfg = task.archiving_cfg

        fetch_from_archive = False if not archiving_cfg else archiving_cfg.fetch_from_archive
        # Schedule the job as soon as possible
        queue = Q_ARCHIVE_JOBS if fetch_from_archive else Q_CREATION_JOBS
        job_id = self._scheduler.schedule_job_task(queue,
                                                   task.task_id, job_args,
                                                   delay=0)

        logger.info("Job #%s (task: %s) scheduled", job_id, task.task_id)

        return job_id
def schedule_task(self, task_id):
        """Schedule a task.

        :param task_id: identifier of the task to schedule

        :raises NotFoundError: raised when the requested task is not
            found in the registry
        """
        task = self.registry.get(task_id)

        job_args = self._build_job_arguments(task)

        archiving_cfg = task.archiving_cfg

        fetch_from_archive = False if not archiving_cfg else archiving_cfg.fetch_from_archive
        # Schedule the job as soon as possible
        queue = Q_ARCHIVE_JOBS if fetch_from_archive else Q_CREATION_JOBS
        job_id = self._scheduler.schedule_job_task(queue,
                                                   task.task_id, job_args,
                                                   delay=0)

        logger.info("Job #%s (task: %s) scheduled", job_id, task.task_id)

        return job_id
Schedule a task.

        :param task_id: identifier of the task to schedule

        :raises NotFoundError: raised when the requested task is not
            found in the registry