mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-21 23:55:17 -05:00
Compare commits
No commits in common. "5b2a59fae39eae4f3990be2d3d1a773da6d0e72c" and "1a7694e7e2b16e58716fd4ad43fc9ffe07793337" have entirely different histories.
5b2a59fae3
...
1a7694e7e2
@ -110,16 +110,6 @@ aprsd_opts = [
|
||||
default=3,
|
||||
help="The number of times to send an ack packet in response to recieving a packet.",
|
||||
),
|
||||
cfg.IntOpt(
|
||||
"packet_list_maxlen",
|
||||
default=100,
|
||||
help="The maximum number of packets to store in the packet list.",
|
||||
),
|
||||
cfg.IntOpt(
|
||||
"packet_list_stats_maxlen",
|
||||
default=20,
|
||||
help="The maximum number of packets to send in the stats dict for admin ui.",
|
||||
),
|
||||
]
|
||||
|
||||
watch_list_opts = [
|
||||
|
@ -22,7 +22,7 @@ class PacketList(objectstore.ObjectStoreMixin):
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if cls._instance is None:
|
||||
cls._instance = super().__new__(cls)
|
||||
cls._maxlen = CONF.packet_list_maxlen
|
||||
cls._maxlen = 100
|
||||
cls.data = {
|
||||
"types": {},
|
||||
"packets": OrderedDict(),
|
||||
@ -88,22 +88,11 @@ class PacketList(objectstore.ObjectStoreMixin):
|
||||
|
||||
@wrapt.synchronized(lock)
|
||||
def stats(self, serializable=False) -> dict:
|
||||
# limit the number of packets to return to 50
|
||||
LOG.info(f"PacketList stats called len={len(self.data['packets'])}")
|
||||
tmp = OrderedDict(reversed(list(self.data["packets"].items())))
|
||||
pkts = []
|
||||
count = 1
|
||||
for packet in tmp:
|
||||
pkts.append(tmp[packet])
|
||||
count += 1
|
||||
if count > CONF.packet_list_stats_maxlen:
|
||||
break
|
||||
|
||||
stats = {
|
||||
"total_tracked": self._total_rx + self._total_rx,
|
||||
"rx": self._total_rx,
|
||||
"tx": self._total_tx,
|
||||
"types": self.data["types"],
|
||||
"packets": pkts,
|
||||
"packets": self.data["packets"],
|
||||
}
|
||||
return stats
|
||||
|
@ -115,11 +115,14 @@ class APRSDDupeRXThread(APRSDRXThread):
|
||||
found = False
|
||||
|
||||
if not found:
|
||||
# We haven't seen this packet before, so we process it.
|
||||
# If we are in the process of already ack'ing
|
||||
# a packet, we should drop the packet
|
||||
# because it's a dupe within the time that
|
||||
# we send the 3 acks for the packet.
|
||||
pkt_list.rx(packet)
|
||||
self.packet_queue.put(packet)
|
||||
elif packet.timestamp - found.timestamp < CONF.packet_dupe_timeout:
|
||||
# If the packet came in within N seconds of the
|
||||
# If the packet came in within 60 seconds of the
|
||||
# Last time seeing the packet, then we drop it as a dupe.
|
||||
LOG.warning(f"Packet {packet.from_call}:{packet.msgNo} already tracked, dropping.")
|
||||
else:
|
||||
|
@ -1,6 +1,6 @@
|
||||
FROM python:3.11-slim as build
|
||||
|
||||
ARG VERSION=3.4.0
|
||||
ARG VERSION=3.1.0
|
||||
ENV TZ=${TZ:-US/Eastern}
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
Loading…
Reference in New Issue
Block a user