From 3f9e6bc3d16a9eb447043110946b4fd37b07c38f Mon Sep 17 00:00:00 2001 From: yuuto Date: Tue, 4 Aug 2026 23:37:36 +0200 Subject: [PATCH] fix(arch-updater): reduce CPU work in the HTTP callback --- arch-updater/plugin.toml | 2 +- arch-updater/service.luau | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch-updater/plugin.toml b/arch-updater/plugin.toml index c21e7d0..e372c13 100644 --- a/arch-updater/plugin.toml +++ b/arch-updater/plugin.toml @@ -1,6 +1,6 @@ id = "yuuto/arch-updater" name = "Arch Updater" -version = "1.0.0" +version = "1.0.1" plugin_api = 9 author = "yuuto" license = "MIT" diff --git a/arch-updater/service.luau b/arch-updater/service.luau index 60e0a85..6c526d6 100644 --- a/arch-updater/service.luau +++ b/arch-updater/service.luau @@ -54,6 +54,7 @@ local sinceCheck = 0 local startupTicks = 0 local sinceNewsCheck = 0 local newsStateLoaded = false +local newsDirty = false local startCheck local checkNews @@ -537,7 +538,7 @@ checkNews = function() local parsed, items = pcall(parseNewsFeed, res.body) if parsed and type(items) == "table" then applyNewsItems(items) - publish() + newsDirty = true end end) if not ok then @@ -737,6 +738,11 @@ function update() checkNews() end end + + if newsDirty then + newsDirty = false + publish() + end end noctalia.setUpdateInterval(1000)