Skip to content

Commit

Permalink
fix: duplicate Sendbackmessagetorrent
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed Dec 23, 2023
1 parent 41863ec commit b175dd3
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/qbit/qbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,26 @@ func getData(r *prometheus.Registry, data Data, goroutine bool) bool {
}
switch data.Ref {
case "preference":

var result models.TypePreferences

if err := json.Unmarshal(body, &result); err != nil {
log.Error("Can not unmarshal JSON for preferences")
} else {
prom.Sendbackmessagepreference(&result, r)
}
prom.Sendbackmessagepreference(&result, r)
case "info":
var result models.TypeInfo
if err := json.Unmarshal(body, &result); err != nil {
log.Error("Can not unmarshal JSON for torrents info")
} else {
prom.Sendbackmessagetorrent(&result, r)
}
prom.Sendbackmessagetorrent(&result, r)
case "maindata":
var result models.TypeMaindata
if err := json.Unmarshal(body, &result); err != nil {
log.Error("Can not unmarshal JSON for maindata")
} else {
prom.Sendbackmessagemaindata(&result, r)
}
prom.Sendbackmessagemaindata(&result, r)
case "qbitversion":

qbittorrent_app_version := prometheus.NewGauge(prometheus.GaugeOpts{
Expand Down

0 comments on commit b175dd3

Please sign in to comment.