ashb commented on a change in pull request #14454:
URL: https://github.com/apache/airflow/pull/14454#discussion_r583686852



##########
File path: airflow/stats.py
##########
@@ -348,25 +348,28 @@ def timer(self, stat=None, *args, tags=None, **kwargs):
 
 
 class _Stats(type):
+    factory = None
     instance: Optional[StatsLogger] = None
 
     def __getattr__(cls, name):
+        if not cls.instance:
+            try:
+                cls.instance = cls.factory()
+            except (socket.gaierror, ImportError) as e:
+                log.error("Could not configure StatsClient: %s, using 
DummyStatsLogger instead.", e)

Review comment:
       Oh no, cos this is a metaclass.




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


Reply via email to