mhenc commented on code in PR #28425: URL: https://github.com/apache/airflow/pull/28425#discussion_r1052603868
########## airflow/cli/commands/internal_api_command.py: ########## @@ -0,0 +1,268 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Internal API command.""" +from __future__ import annotations + +import logging +import os +import signal +import subprocess +import sys +import textwrap +from contextlib import suppress +from tempfile import gettempdir +from time import sleep + +import daemon +import psutil +from daemon.pidfile import TimeoutPIDLockFile +from flask import Flask +from flask_appbuilder import SQLA +from flask_caching import Cache +from flask_wtf.csrf import CSRFProtect +from lockfile.pidlockfile import read_pid_from_pidfile +from sqlalchemy.engine.url import make_url + +from airflow import settings +from airflow.cli.commands.webserver_command import GunicornMonitor +from airflow.configuration import conf +from airflow.exceptions import AirflowConfigException +from airflow.logging_config import configure_logging +from airflow.models import import_all_models +from airflow.utils import cli as cli_utils +from airflow.utils.cli import setup_locations, setup_logging +from airflow.utils.process_utils import check_if_pidfile_process_is_running +from airflow.www.extensions.init_dagbag import init_dagbag +from airflow.www.extensions.init_jinja_globals import init_jinja_globals +from airflow.www.extensions.init_manifest_files import configure_manifest_files +from airflow.www.extensions.init_security import init_xframe_protection +from airflow.www.extensions.init_views import init_api_internal, init_error_handlers + +log = logging.getLogger(__name__) +app: Flask | None = None + + +@cli_utils.action_cli +def internal_api(args): + """Starts Airflow Internal API.""" + print(settings.HEADER) + + access_logfile = args.access_logfile if args.access_logfile is not None else "-" + error_logfile = args.error_logfile if args.error_logfile is not None else "-" Review Comment: But this will default to "-" if *_logfile is empty string - not sure if this is intended ? WDYT? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
