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
1 changed files with 8 additions and 2 deletions

View File

@ -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()