Skip to content

Commit

Permalink
Fix service count toast (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall authored Nov 4, 2023
2 parents 7509798 + 9218aa2 commit 344ae09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/client/tray.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (c *Client) notifiarrMenuActions() {
menu["syncqp"].Click(func() { c.triggers.CFSync.SyncSonarrRP(website.EventUser) })
menu["svcs_prod"].Click(func() {
c.Print("[user requested] Checking services and sending results to Notifiarr.")
ui.Notify("Running and sending %d Service Checks.", len(c.Config.Service))
ui.Notify("Running and sending %d Service Checks.", c.Config.Services.SvcCount())
c.Config.Services.RunChecks(website.EventUser)
})
menu["plex_prod"].Click(func() { c.triggers.PlexCron.Send(website.EventUser) })
Expand Down Expand Up @@ -323,7 +323,7 @@ func (c *Client) debugMenu() {
menu["svcs_log"] = debug.AddSubMenuItem("Log Service Checks", "check all services and log results")
menu["svcs_log"].Click(func() {
c.Print("[user requested] Checking services and logging results.")
ui.Notify("Running and logging %d Service Checks.", len(c.Config.Service))
ui.Notify("Running and logging %d Service Checks.", c.Config.Services.SvcCount())
c.Config.Services.RunChecks("log")
})

Expand Down
5 changes: 5 additions & 0 deletions pkg/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,8 @@ func (c *Config) Stop() {
c.done = nil
c.stopChan = nil
}

// SvcCount returns the count of services being monitored.
func (c *Config) SvcCount() int {
return len(c.services)
}

0 comments on commit 344ae09

Please sign in to comment.