From 5d3f42f411d801f0bdb22ae8a172528b19a8d89e Mon Sep 17 00:00:00 2001 From: Hemna Date: Thu, 7 Mar 2024 08:37:09 -0500 Subject: [PATCH] Make registry thread sleep This patch adds a required sleep of 1 second in each registry thread loop to prevent runaway cpu usage --- aprsd/threads/registry.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aprsd/threads/registry.py b/aprsd/threads/registry.py index 503bc18..8fb7a66 100644 --- a/aprsd/threads/registry.py +++ b/aprsd/threads/registry.py @@ -1,4 +1,5 @@ import logging +import time from oslo_config import cfg import requests @@ -50,4 +51,5 @@ class APRSRegistryThread(aprsd_threads.APRSDThread): except Exception as e: LOG.error(f"Failed to send registry info: {e}") + time.sleep(1) return True