mirror of
https://github.com/MedzikUser/go-pingbot
synced 2024-08-14 23:57:07 +00:00
fix: delete cluster option (not used in latest config)
This commit is contained in:
parent
8f64eb1dcb
commit
7240621ead
4 changed files with 7 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -4,3 +4,6 @@ go mod tidy
|
|||
|
||||
# Lint
|
||||
go fmt ./...
|
||||
|
||||
# Add changes
|
||||
git add .
|
||||
|
|
|
@ -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),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue