1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-21 23:55:17 -05:00

Compare commits

..

No commits in common. "66e48503537cbe17c9e24794963fc90d4235e4b3" and "026dc6e3761019308dd609a8d0e610c13425bfca" have entirely different histories.

4 changed files with 6 additions and 13 deletions

View File

@ -105,11 +105,6 @@ aprsd_opts = [
"'multiline' will use multiple lines for each packet and is the traditional format."
"both will log both compact and multiline.",
),
cfg.IntOpt(
"default_ack_send_count",
default=3,
help="The number of times to send an ack packet in response to recieving a packet.",
),
]
watch_list_opts = [

View File

@ -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 = 50
cls._maxlen = 100
cls.data = {
"types": {},
"packets": OrderedDict(),

View File

@ -77,9 +77,8 @@ class APRSDThreadList:
age = th.loop_age()
if serializable:
age = str(age)
stats[th.name] = {
stats[th.__class__.__name__] = {
"name": th.name,
"class": th.__class__.__name__,
"alive": th.is_alive(),
"age": th.loop_age(),
"loop_count": th.loop_count,

View File

@ -127,7 +127,8 @@ class SendPacketThread(aprsd_threads.APRSDThread):
"Message Send Complete. Max attempts reached"
f" {packet.retry_count}",
)
pkt_tracker.remove(packet.msgNo)
if not packet.allow_delay:
pkt_tracker.remove(packet.msgNo)
return False
# Message is still outstanding and needs to be acked.
@ -157,24 +158,22 @@ class SendPacketThread(aprsd_threads.APRSDThread):
class SendAckThread(aprsd_threads.APRSDThread):
loop_count: int = 1
max_retries = 3
def __init__(self, packet):
self.packet = packet
super().__init__(f"SendAck-{self.packet.msgNo}")
self.max_retries = CONF.default_ack_send_count
def loop(self):
"""Separate thread to send acks with retries."""
send_now = False
if self.packet.send_count == self.max_retries:
if self.packet.send_count == self.packet.retry_count:
# we reached the send limit, don't send again
# TODO(hemna) - Need to put this in a delayed queue?
LOG.debug(
f"{self.packet.__class__.__name__}"
f"({self.packet.msgNo}) "
"Send Complete. Max attempts reached"
f" {self.max_retries}",
f" {self.packet.retry_count}",
)
return False