jscheffl commented on code in PR #46416:
URL: https://github.com/apache/airflow/pull/46416#discussion_r1941214114
##########
providers/edge/src/airflow/providers/edge/cli/edge_command.py:
##########
@@ -295,7 +295,18 @@ def start(self):
logger.info("Quitting worker, signal being offline.")
try:
- worker_set_state(self.hostname, EdgeWorkerState.OFFLINE, 0,
self.queues, self._get_sysinfo())
+ if _EdgeWorkerCli.maintenance_mode:
+ worker_set_state(
+ self.hostname,
+ EdgeWorkerState.OFFLINE_MAINTENANCE,
+ 0,
+ self.queues,
+ self._get_sysinfo(),
+ )
+ else:
+ worker_set_state(
+ self.hostname, EdgeWorkerState.OFFLINE, 0,
self.queues, self._get_sysinfo()
+ )
Review Comment:
I think this can be made a bit simpler/shorter:
```suggestion
worker_set_state(
self.hostname,
EdgeWorkerState.OFFLINE_MAINTENANCE if
_EdgeWorkerCli.maintenance_mode else EdgeWorkerState.OFFLINE,
0,
self.queues,
self._get_sysinfo(),
)
```
--
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]