[FIX] Run scheduler within Flask app context