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
|
||||
|
||||
import "go.mongodb.org/mongo-driver/bson/primitive"
|
||||
|
||||
type URL struct {
|
||||
URL string `bson:"_id,omitempty" json:"url,omitempty"`
|
||||
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
|
||||
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
|
||||
URL string `bson:"url,omitempty" json:"url,omitempty"`
|
||||
Cluster int `bson:"cluster,omitempty" json:"cluster,omitempty"`
|
||||
}
|
||||
|
|
|
@ -40,5 +40,7 @@ func StopAfterPing() {
|
|||
|
||||
break
|
||||
}
|
||||
|
||||
time.Sleep(100 * time.Millisecond) // 0.1 second
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue