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
Backend backendConfig
AutoUpdate autoUpdateConfig
Cluster clusterConfig
MongoDB mongoDBConfig
Options optionsConfig
}
@ -34,10 +33,6 @@ type autoUpdateConfig struct {
Check time.Duration
}
type clusterConfig struct {
ID int
}
type mongoDBConfig struct {
Database string
Collection string

View File

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

View File

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

View File

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