potiuk commented on code in PR #30255:
URL: https://github.com/apache/airflow/pull/30255#discussion_r1147258375
##########
airflow/cli/commands/standalone_command.py:
##########
@@ -235,13 +236,13 @@ def port_open(self, port):
return False
return True
- def job_running(self, job):
+ def job_running(self, job_runner_class: type[BaseJobRunner]):
"""
Checks if the given job name is running and heartbeating correctly.
Used to tell if scheduler is alive.
"""
- recent = job.most_recent_job()
+ recent = job_runner_class.most_recent_job()
Review Comment:
Why. I am happy to make changes even in trivial things.
Yes. I had this initially exactly this way, but I found that this has a bit
of a problem for those who got used to XXXJob.most_recent_job (polimorhism made
sure that we were selecting the "right" job_type. It feels a bit better to run
this query with "class" context rather than pass the context to is. But I will
see - maybe coupled with making the Job type class variable it would make sense
actually.
##########
airflow/jobs/scheduler_job.py:
##########
@@ -798,6 +802,11 @@ def _execute(self) -> None:
except Exception:
self.log.exception("Exception when executing
DagFileProcessorAgent.end")
self.log.info("Exited execute loop")
+ return None
+
+ @staticmethod
+ def get_job_type() -> str:
+ return "SchedulerJob"
Review Comment:
yes.
--
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]