mirror of https://github.com/MedzikUser/go-pingbot
perf(database): change _id field to url
BREAKING CHANGE: YOU MUST CHANGE `_id` TO `url` AND GENERATE ObjectID to `_id` IN MONGODB.
This commit is contained in:
parent
5ebc9a5b0a
commit
8f64eb1dcb
|
@ -1,6 +1,9 @@
|
||||||
package mongo
|
package mongo
|
||||||
|
|
||||||
|
import "go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
|
||||||
type URL struct {
|
type URL struct {
|
||||||
URL string `bson:"_id,omitempty" json:"url,omitempty"`
|
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
|
||||||
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
|
URL string `bson:"url,omitempty" json:"url,omitempty"`
|
||||||
|
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,5 +40,7 @@ func StopAfterPing() {
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(100 * time.Millisecond) // 0.1 second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue