fix(arch-updater): reduce CPU work in the HTTP callback

This commit is contained in:
yuuto
2026-08-04 23:40:15 +02:00
parent f0134c2938
commit 3f9e6bc3d1
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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"
+7 -1
View File
@@ -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)