From b5972287196130ea873ee00a8713cf56e5d543b3 Mon Sep 17 00:00:00 2001 From: craigerl Date: Sat, 5 Dec 2020 18:59:58 -0800 Subject: [PATCH] main loop went into tight loop, added debug print before every continue --- aprsd/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aprsd/main.py b/aprsd/main.py index d8c51a1..8914614 100644 --- a/aprsd/main.py +++ b/aprsd/main.py @@ -642,6 +642,8 @@ def main(args=args): LOG.info("Start main loop") while True: + LOG.debug("Main loop start") + time.sleep(1) # prevent tight loop with 100% cpu line = "" try: line = sock_file.readline().strip() @@ -653,6 +655,7 @@ def main(args=args): (fromcall, message, ack) = process_message(line) else: message = "noise" + LOG.debug("continue: noise") continue # ACK (ack##) @@ -660,7 +663,6 @@ def main(args=args): # put message_number:1 in dict to record the ack a = re.search('^ack([0-9]+)', message) ack_dict.update({int(a.group(1)): 1}) - continue # EMAIL (-) # is email command @@ -819,14 +821,18 @@ def main(args=args): sock.close() setup_connection() sock.send("user %s pass %s vers https://github.com/craigerl/aprsd 2.00\n" % (user, password)) + LOG.debug("continue: connection fail") continue # LOG.error("Exiting.") # os._exit(1) time.sleep(5) + LOG.debug("contnue: don't know what failed: " + str(e)) continue # don't know what failed, so wait and then continue main loop again - # end while True + LOG.debug("Main loop end") + # end while True + sock.shutdown(0) sock.close()