mik-laj commented on a change in pull request #7559: [AIRFLOW-6935] Pass the
SchedulerJob configuration using the constructor
URL: https://github.com/apache/airflow/pull/7559#discussion_r385123579
##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -991,10 +1057,13 @@ def is_alive(self, grace_multiplier=None):
if grace_multiplier is not None:
# Accept the same behaviour as superclass
return super().is_alive(grace_multiplier=grace_multiplier)
- scheduler_health_check_threshold = conf.getint('scheduler',
'scheduler_health_check_threshold')
+ # The object can be retrieved from the database, so it does not
contain all the attributes.
+ self.scheduler_health_check_threshold = conf.getint(
Review comment:
The problem is related to the fact that we use the database entities as
elements of building the application. Not only as a place to store data. In
most cases, however, the schedulerJob is an application logic object and only
in rare cases a database object. I would like to separate it, but to do this,
most of the code must be used correctly ie the configuration parameters are
passed by the constructor. If we divide these two aspects in the code, we will
be able to make changes much easier and e.g. replace SQLAlchemy with Redis.
----------------------------------------------------------------
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