amoghrajesh commented on code in PR #52952:
URL: https://github.com/apache/airflow/pull/52952#discussion_r2189269782
##########
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py:
##########
@@ -213,12 +214,18 @@ def change_maintenance_comment(self, worker_name: str):
except AirflowConfigException:
EDGE_EXECUTOR_ACTIVE = False
+# Load the API endpoint only on api-server (Airflow 3.x) or webserver (Airflow
2.x)
+if AIRFLOW_V_3_0_PLUS:
+ RUNNING_ON_APISERVER = sys.argv[1] in ["api-server"] if len(sys.argv) > 1
else False
+else:
+ RUNNING_ON_APISERVER = "gunicorn" in sys.argv[0] and "airflow-webserver"
in sys.argv
Review Comment:
> I feel like in a couple of areas we initialize too much.
I share this feeling.
##########
providers/edge3/src/airflow/providers/edge3/plugins/edge_executor_plugin.py:
##########
@@ -213,12 +214,18 @@ def change_maintenance_comment(self, worker_name: str):
except AirflowConfigException:
EDGE_EXECUTOR_ACTIVE = False
+# Load the API endpoint only on api-server (Airflow 3.x) or webserver (Airflow
2.x)
+if AIRFLOW_V_3_0_PLUS:
+ RUNNING_ON_APISERVER = sys.argv[1] in ["api-server"] if len(sys.argv) > 1
else False
+else:
+ RUNNING_ON_APISERVER = "gunicorn" in sys.argv[0] and "airflow-webserver"
in sys.argv
Review Comment:
Would AF3 check not be enough?
--
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]