diff --git a/aprsd/threads/__init__.py b/aprsd/threads/__init__.py index 3801387..7946b6d 100644 --- a/aprsd/threads/__init__.py +++ b/aprsd/threads/__init__.py @@ -7,6 +7,5 @@ from .rx import ( # noqa: F401 APRSDProcessPacketThread, APRSDRXThread, ) -from .stats import APRSDStatsStoreThread, StatsLogThread # noqa: F401 packet_queue = queue.Queue(maxsize=500) diff --git a/aprsd/threads/stats.py b/aprsd/threads/stats.py index a69b384..7a891db 100644 --- a/aprsd/threads/stats.py +++ b/aprsd/threads/stats.py @@ -5,6 +5,8 @@ import time from loguru import logger from oslo_config import cfg +from aprsd.packets import seen_list +from aprsd.stats import collector from aprsd.threads import APRSDThread from aprsd.utils import objectstore @@ -35,9 +37,6 @@ class APRSDStatsStoreThread(APRSDThread): def loop(self): if self.loop_count % self.save_interval == 0: - # Lazy import to avoid circular dependency - from aprsd.stats import collector - stats = collector.Collector().collect() ss = StatsStore() ss.add(stats) @@ -58,10 +57,6 @@ class StatsLogThread(APRSDThread): def loop(self): if self.loop_count % self.period == 0: - # Lazy imports to avoid circular dependency - from aprsd.packets import seen_list - from aprsd.stats import collector - # log the stats every 10 seconds stats_json = collector.Collector().collect(serializable=True) stats = stats_json['PacketList']