From 82ffc364d34f4906ef4c4c1bd4bd202d393a46bc Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 14 Dec 2025 13:34:26 +0300 Subject: Chore: remove unused ticker --- bot.go | 11 +---------- props_table.go | 5 +---- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/bot.go b/bot.go index 3242b88..e2f03b8 100644 --- a/bot.go +++ b/bot.go @@ -841,15 +841,6 @@ func updateModelLists() { } } -func updateModelListsTicker() { - updateModelLists() // run on the start - ticker := time.NewTicker(time.Minute * 1) - for { - <-ticker.C - updateModelLists() - } -} - func init() { var err error cfg, err = config.LoadConfig("config.toml") @@ -910,5 +901,5 @@ func init() { if cfg.STT_ENABLED { asr = extra.NewSTT(logger, cfg) } - go updateModelListsTicker() + go updateModelLists() } diff --git a/props_table.go b/props_table.go index 9408469..dfbace8 100644 --- a/props_table.go +++ b/props_table.go @@ -140,9 +140,7 @@ func makePropsTable(props map[string]float32) *tview.Table { } return LocalModels } - var modelRowIndex int // will be set before model row is added - // Prepare API links dropdown - insert current API at the beginning apiLinks := slices.Insert(cfg.ApiLinks, 0, cfg.CurrentAPI) addListPopupRow("Select an api", apiLinks, cfg.CurrentAPI, func(option string) { @@ -169,7 +167,6 @@ func makePropsTable(props map[string]float32) *tview.Table { } } }) - // Prepare model list dropdown modelRowIndex = row modelCellID = fmt.Sprintf("listpopup_%d", modelRowIndex) @@ -276,7 +273,7 @@ func makePropsTable(props map[string]float32) *tview.Table { // Handle nil options if data.Options == nil { logger.Error("options list is nil for", "label", label) - if err := notifyUser("Configuration error", "Options list is nil for " + label); err != nil { + if err := notifyUser("Configuration error", "Options list is nil for "+label); err != nil { logger.Error("failed to send notification", "error", err) } return -- cgit v1.2.3