Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
perf(database): change _id field to url
Browse files Browse the repository at this point in the history
BREAKING CHANGE: YOU MUST CHANGE `_id` TO `url` AND GENERATE ObjectID to `_id` IN MONGODB.
  • Loading branch information
M3DZIK committed Sep 8, 2021
1 parent 5ebc9a5 commit 8f64eb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions database/mongo/types.go
Original file line number Diff line number Diff line change
@@ -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"`
}
2 changes: 2 additions & 0 deletions ping/stopAfterPing.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ func StopAfterPing() {

break
}

time.Sleep(100 * time.Millisecond) // 0.1 second
}
}

0 comments on commit 8f64eb1

Please sign in to comment.