fix: Reduce train pre-arrival debounce timeout to 2.5 minutes

This commit is contained in:
2026-08-02 11:56:20 +08:00
parent 43a2a4deaf
commit b52776fe09
+3 -3
View File
@@ -2,7 +2,7 @@
-- ============================================================================ -- ============================================================================
-- 1. Configuration & Constants -- 1. Configuration & Constants
-- ============================================================================ -- ============================================================================
local APP_VERSION_TEXT = "v1.0.21" local APP_VERSION_TEXT = "v1.0.22"
local CONFIG = { local CONFIG = {
CLOUD_URL = "ws://stabadmin.fse-media.group", CLOUD_URL = "ws://stabadmin.fse-media.group",
@@ -2256,8 +2256,8 @@ function Main.loop()
local announceKey = tName .. "_" .. dest local announceKey = tName .. "_" .. dest
local now = os.epoch("utc") local now = os.epoch("utc")
-- Prevent spamming: CRN's "1 min" can be fuzzy and stay for a while. -- Prevent spamming: CRN's "1 min" can be fuzzy and stay for a while.
-- We increase the cooldown to 5 minutes (300000 ms) per train per destination. -- We increase the cooldown to 2.5 minutes (150000 ms) per train per destination.
if not State.announcedApproaching[announceKey] or (now - State.announcedApproaching[announceKey] > 300000) then if not State.announcedApproaching[announceKey] or (now - State.announcedApproaching[announceKey] > 150000) then
State.announcedApproaching[announceKey] = now State.announcedApproaching[announceKey] = now
Utils.log("INFO", "Train Approaching: " .. tName) Utils.log("INFO", "Train Approaching: " .. tName)
Network.send({ Network.send({