1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-06-26 05:55:26 -04:00

main loop went into tight loop, added debug print before every continue

This commit is contained in:
craigerl 2020-12-05 18:59:58 -08:00
parent 3ae7a056b6
commit b597228719

View File

@ -642,6 +642,8 @@ def main(args=args):
LOG.info("Start main loop") LOG.info("Start main loop")
while True: while True:
LOG.debug("Main loop start")
time.sleep(1) # prevent tight loop with 100% cpu
line = "" line = ""
try: try:
line = sock_file.readline().strip() line = sock_file.readline().strip()
@ -653,6 +655,7 @@ def main(args=args):
(fromcall, message, ack) = process_message(line) (fromcall, message, ack) = process_message(line)
else: else:
message = "noise" message = "noise"
LOG.debug("continue: noise")
continue continue
# ACK (ack##) # ACK (ack##)
@ -660,7 +663,6 @@ def main(args=args):
# put message_number:1 in dict to record the ack # put message_number:1 in dict to record the ack
a = re.search('^ack([0-9]+)', message) a = re.search('^ack([0-9]+)', message)
ack_dict.update({int(a.group(1)): 1}) ack_dict.update({int(a.group(1)): 1})
continue
# EMAIL (-) # EMAIL (-)
# is email command # is email command
@ -819,14 +821,18 @@ def main(args=args):
sock.close() sock.close()
setup_connection() setup_connection()
sock.send("user %s pass %s vers https://github.com/craigerl/aprsd 2.00\n" % (user, password)) sock.send("user %s pass %s vers https://github.com/craigerl/aprsd 2.00\n" % (user, password))
LOG.debug("continue: connection fail")
continue continue
# LOG.error("Exiting.") # LOG.error("Exiting.")
# os._exit(1) # os._exit(1)
time.sleep(5) 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 continue # don't know what failed, so wait and then continue main loop again
LOG.debug("Main loop end")
# end while True # end while True
sock.shutdown(0) sock.shutdown(0)
sock.close() sock.close()