def get(self): """Finds and enqueues pipelines scheduled to be executed now.""" for pipeline in Pipeline.where(run_on_schedule=True).all(): logging.info('Checking schedules for pipeline %s', pipeline.name) for schedule in pipeline.schedules: logging.info('Checking schedule with cron string %s', schedule.cron) if self._its_time(schedule.cron): logging.info('Trying to start pipeline %s', pipeline.name) pipeline.start() break return 'OK', 200
def get(self): """Finds and enqueues pipelines scheduled to be executed now.""" for pipeline in Pipeline.where(run_on_schedule=True).all(): logging.info('Checking schedules for pipeline %s', pipeline.name) for schedule in pipeline.schedules: logging.info('Checking schedule with cron string %s', schedule.cron) if self._its_time(schedule.cron): logging.info('Trying to start pipeline %s', pipeline.name) pipeline.start() tracker = insight.GAProvider() tracker.track_event(category='pipelines', action='scheduled_run') break return 'OK', 200