[
https://issues.apache.org/jira/browse/AIRFLOW-5615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17112532#comment-17112532
]
ASF GitHub Bot commented on AIRFLOW-5615:
-----------------------------------------
houqp commented on a change in pull request #6311:
URL: https://github.com/apache/airflow/pull/6311#discussion_r428236112
##########
File path: airflow/jobs/base_job.py
##########
@@ -147,7 +147,7 @@ def heartbeat_callback(self, session=None):
Callback that is called during heartbeat. This method should be
overwritten.
"""
- def heartbeat(self):
+ def heartbeat(self, only_if_necessary=False):
Review comment:
yes, having type hint prevents caller from passing in with a variable of
wrong type by accident. it will also help with type checking within this method
anywhere `only_if_necessary` is used.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> BaseJob subclasses shouldn't implement own heartbeat logic
> ----------------------------------------------------------
>
> Key: AIRFLOW-5615
> URL: https://issues.apache.org/jira/browse/AIRFLOW-5615
> Project: Apache Airflow
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.10.5
> Reporter: Ash Berlin-Taylor
> Assignee: Ash Berlin-Taylor
> Priority: Trivial
> Fix For: 2.0.0
>
>
> Both SchedulerJob and LocalTaskJob have their own timers and decide when to
> call heartbeat based upon that.
> That logic should be removed and live in BaseJob to simplify the code.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)