From 19adda03d9b49916236fcfd391e3fd35363ae2a7 Mon Sep 17 00:00:00 2001 From: irl Date: Mon, 28 Apr 2025 15:13:52 +0100 Subject: [PATCH] fix(updater): do not pin CPU at 100% while waiting for next run --- legacy/updater.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/legacy/updater.lua b/legacy/updater.lua index fcc2ece..7242790 100644 --- a/legacy/updater.lua +++ b/legacy/updater.lua @@ -1,7 +1,11 @@ local cjson = require('cjson') local http = require('socket.http') -local stdlib = require('posix.stdlib') local redis = require('redis') +local socket = require('socket') +local stdlib = require('posix.stdlib') + +-- TODO: Logging formatting +-- TODO: Monitoring local client = redis.connect('redis', 6379) @@ -85,4 +89,5 @@ while true do end last_update_time = current_time end + socket.sleep(1) end