We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssdbPool, err = gossdb.NewPool(&gossdb.Config{ Host: ssdb_addr[0], Port: port, MinPoolSize: 5, MaxPoolSize: 200, AcquireIncrement: 5,
})
//导入代码部份 conn, err := ssdbPool.NewClient() if err != nil { log.Println("myg ssdb:", err.Error()) return } defer conn.Close() _, err = conn.Qpush_front("visit", testvisit)
是 不是写的有问题,不是的话,就有问题了,导致最后程序无法链接。
The text was updated successfully, but these errors were encountered:
我在爬虫里试过,是可以的,请检查一下你的程序部分,协程是否都及时关闭了,看你给出的代码是没有问题。可以打印日志看一下。
也可以用下面的代码测试一下
package main import ( "log" "time" "github.com/seefan/gossdb/ssdb" ) func main() { if err := ssdb.Start(); err != nil { log.Printf("ssdb连接错误", err) return } for i := 0; i < 10000; i++ { c, err := ssdb.Client() if err != nil { log.Printf("error %s", err.Error()) break } c.Qpush_front("test", 1) time.Sleep(time.Microsecond) c.Close() log.Println(i) } }
Sorry, something went wrong.
the problem is solved at the following merge, you can test it again. Merge pull request #23 from DavidGSX/master
No branches or pull requests
ssdbPool, err = gossdb.NewPool(&gossdb.Config{
Host: ssdb_addr[0],
Port: port,
MinPoolSize: 5,
MaxPoolSize: 200,
AcquireIncrement: 5,
//导入代码部份
conn, err := ssdbPool.NewClient()
if err != nil {
log.Println("myg ssdb:", err.Error())
return
}
defer conn.Close()
_, err = conn.Qpush_front("visit", testvisit)
是 不是写的有问题,不是的话,就有问题了,导致最后程序无法链接。
The text was updated successfully, but these errors were encountered: