@@ -0,0 +1,24 @@
|
||||
package appg
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"91porn-server/common/elastic"
|
||||
"91porn-server/common/log"
|
||||
)
|
||||
|
||||
func InitElastic() {
|
||||
opts := elastic.Options{
|
||||
Address: []string{Conf.Elastic.VideoUrl},
|
||||
MaxIdleConnsPerHost: 10,
|
||||
IdleConnTimeout: 30,
|
||||
UserName: Conf.Elastic.UserName,
|
||||
PassWord: Conf.Elastic.PassWord,
|
||||
}
|
||||
c, err := elastic.InitElastic(opts)
|
||||
if err != nil {
|
||||
log.Error("startUp VideoES InitElastic error", log.E(err))
|
||||
os.Exit(1)
|
||||
}
|
||||
VideoES = c
|
||||
}
|
||||
Reference in New Issue
Block a user