hussein-awala commented on code in PR #33084:
URL: https://github.com/apache/airflow/pull/33084#discussion_r1283761173


##########
airflow/jobs/job.py:
##########
@@ -117,6 +115,15 @@ def __init__(self, executor=None, heartrate=None, 
**kwargs):
     def executor(self):
         return ExecutorLoader.get_default_executor()
 
+    @cached_property
+    def heartrate(self):
+        if self.job_type == "TriggererJob":
+            return conf.getfloat("triggerer", "JOB_HEARTBEAT_SEC")
+        else:
+            # Heartrate used to be hardcoded to scheduler, so in all other
+            # cases continue to use that value for back compat
+            return conf.getfloat("scheduler", "JOB_HEARTBEAT_SEC")
+

Review Comment:
   I wonder if we can avoid implementing this logic in the parent class (job 
class), where doing so, we will have to add a case for each future job runner.
   
   Currently for Triggerer Job, we pass the heartbeat as a parameter when we 
run the triggerer command:
   
https://github.com/apache/airflow/blob/56c41d460c3f2a4e871c7834033c3152e71f71d2/airflow/cli/commands/triggerer_command.py#L60-L61
   
   Why do we need to override the default value too?



-- 
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]

Reply via email to