kaxil commented on a change in pull request #7269: [AIRFLOW-6651] Add Redis
Heartbeat option
URL: https://github.com/apache/airflow/pull/7269#discussion_r383517536
##########
File path: airflow/jobs/base_job.py
##########
@@ -102,7 +112,16 @@ def most_recent_job(cls, session=None) ->
Optional['BaseJob']:
:param session: Database session
:rtype: BaseJob or None
"""
- return
session.query(cls).order_by(cls.latest_heartbeat.desc()).limit(1).first()
+ latest_job_sql =
session.query(cls).order_by(cls._legacy_heartbeat.desc()).limit(1).first()
+ if conf.getboolean('heartbeat', 'redis_enabled'):
+ latest_id = cls.redis.zrange(cls.__name__, -1, -1)
Review comment:
Will this mean that the heartbeat will be written at both places? Redis and
the metadata db?
----------------------------------------------------------------
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]
With regards,
Apache Git Services