def METHOD_NAME(reconnect=True):
    scheduler = BackgroundScheduler()
    if scheduler:
        # Remove all existing jobs
        scheduler.remove_all_jobs()
        start = config.schedule_start_time
        duration = config.schedule_duration
        # Register scheduled tasks
        scheduler.schedule_tasks(tasks=get_scheduled_tasks(reconnect), trigger=CronTrigger(hour=start))
        end_time = calclulate_end_time(start, duration)
        scheduler.schedule(func=end_scheduled_tasks, trigger=CronTrigger(hour=end_time.hour, minute=end_time.minute),
                           name="end scheduled task")
        # Kick-off tasks, if they should currently be running
        if should_task_be_running(start, duration):
            scheduler.schedule_tasks_immediately(tasks=get_scheduled_tasks(reconnect))