fix: delete cluster option (not used in latest config)

This commit is contained in:
Medzik 2021-09-09 18:55:36 +00:00
parent 8f64eb1dcb
commit 7240621ead
4 changed files with 7 additions and 16 deletions

View File

@ -14,7 +14,6 @@ type tomlConfig struct {
HTTP httpConfig HTTP httpConfig
Backend backendConfig Backend backendConfig
AutoUpdate autoUpdateConfig AutoUpdate autoUpdateConfig
Cluster clusterConfig
MongoDB mongoDBConfig MongoDB mongoDBConfig
Options optionsConfig Options optionsConfig
} }
@ -34,10 +33,6 @@ type autoUpdateConfig struct {
Check time.Duration Check time.Duration
} }
type clusterConfig struct {
ID int
}
type mongoDBConfig struct { type mongoDBConfig struct {
Database string Database string
Collection string Collection string

View File

@ -3,8 +3,6 @@ package mongo
import ( import (
"context" "context"
"time" "time"
"gitlab.com/gaming0skar123/go/pingbot/config"
) )
func GetAll() ([]URL, error) { func GetAll() ([]URL, error) {
@ -13,9 +11,7 @@ func GetAll() ([]URL, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()
cursor, err := Coll.Find(ctx, URL{ cursor, err := Coll.Find(ctx, URL{})
Cluster: config.Toml.Cluster.ID,
})
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -4,3 +4,6 @@ go mod tidy
# Lint # Lint
go fmt ./... go fmt ./...
# Add changes
git add .

View File

@ -34,6 +34,7 @@ func Status(c *gin.Context) {
c.JSON(http.StatusOK, json{ c.JSON(http.StatusOK, json{
"ping": p, "ping": p,
"sys": json{ "sys": json{
"uptime": common.Uptime(config.StartTime),
"pid": cpu.PID, "pid": cpu.PID,
"os": runtime.GOOS, "os": runtime.GOOS,
"mem": json{ "mem": json{
@ -53,9 +54,5 @@ func Status(c *gin.Context) {
"release": config.Version, "release": config.Version,
"build": config.Build, "build": config.Build,
}, },
"node": json{
"cluster": config.Toml.Cluster.ID,
"uptime": common.Uptime(config.StartTime),
},
}) })
} }