Skip to content

Commit

Permalink
Remove repetitive call to get executor class from config
Browse files Browse the repository at this point in the history
  • Loading branch information
khalidmammadov committed Oct 4, 2021
1 parent 2bcd674 commit 47f43ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions airflow/jobs/base_job.py
Expand Up @@ -96,10 +96,9 @@ class BaseJob(Base, LoggingMixin):
def __init__(self, executor=None, heartrate=None, *args, **kwargs):
self.hostname = get_hostname()
if executor:
# Executor here is used for test suites. So they can inject it for testing
self.executor = executor
self.executor_class = executor.__class__.__name__
else:
self.executor_class = conf.get('core', 'EXECUTOR')
self.executor_class = self.executor.__class__.__name__
self.start_date = timezone.utcnow()
self.latest_heartbeat = timezone.utcnow()
if heartrate is not None:
Expand Down

0 comments on commit 47f43ec

Please sign in to comment.