|
@@ -45,11 +45,7 @@ func Test_fmt(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func Test_Sim(t *testing.T) {
|
|
|
- mgo := &MongodbSim{}
|
|
|
- mgo.MongodbAddr = "192.168.3.207:27083"
|
|
|
- mgo.Size = 9
|
|
|
- mgo.DbName = "qfw"
|
|
|
- mgo.InitPool()
|
|
|
+ mgo := NewMongodbReplPool(5, "192.168.3.207:27083", "qfw", "qfws")
|
|
|
p := make(chan bool, 10)
|
|
|
j := 0
|
|
|
for {
|
|
@@ -74,7 +70,7 @@ func Test_Sim(t *testing.T) {
|
|
|
time.Sleep(50 * time.Second)
|
|
|
log.Println(j, len(mgo.pool), len(mgo.idlePool))
|
|
|
j++
|
|
|
- if j > 2 {
|
|
|
+ if j > 0 {
|
|
|
break
|
|
|
}
|
|
|
}
|