mirror of https://github.com/MedzikUser/go-pingbot
fix: delete cluster option (not used in latest config)
This commit is contained in:
parent
8f64eb1dcb
commit
7240621ead
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,3 +4,6 @@ go mod tidy
|
||||||
|
|
||||||
# Lint
|
# Lint
|
||||||
go fmt ./...
|
go fmt ./...
|
||||||
|
|
||||||
|
# Add changes
|
||||||
|
git add .
|
||||||
|
|
|
@ -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),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue