1
0
mirror of https://github.com/craigerl/aprsd.git synced 2026-02-25 10:40:20 -05:00

don't do lazy imports

This commit is contained in:
Walter Boring 2026-01-09 18:39:49 -05:00
parent 40f8d23db2
commit 9a862c05f9
2 changed files with 2 additions and 8 deletions

View File

@ -7,6 +7,5 @@ from .rx import ( # noqa: F401
APRSDProcessPacketThread,
APRSDRXThread,
)
from .stats import APRSDStatsStoreThread, StatsLogThread # noqa: F401
packet_queue = queue.Queue(maxsize=500)

View File

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