mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -93,5 +93,14 @@ func InitMongo() error {
|
||||
// 赋值给全局mongo session
|
||||
Session = sess
|
||||
}
|
||||
//Add Unique index for 'key'
|
||||
keyIndex := mgo.Index{
|
||||
Key: []string{"key"},
|
||||
Unique: true,
|
||||
}
|
||||
s, c := GetCol("nodes")
|
||||
defer s.Close()
|
||||
c.EnsureIndex(keyIndex)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user