Browse Source

feat:free es 初始化

wangshan 1 year ago
parent
commit
9902826754
1 changed files with 12 additions and 1 deletions
  1. 12 1
      public/db.go

+ 12 - 1
public/db.go

@@ -107,9 +107,20 @@ func init() {
 				Size:     DbConf.Elasticsearch.Other.Size,
 			}
 			Other.Init()
+			log.Println("初始化 Other elasticsearch")
+		}
+
+		if DbConf.Elasticsearch.Free != nil {
+			Free = &elastic.EsV7{
+				Address:  DbConf.Elasticsearch.Free.Address,
+				UserName: DbConf.Elasticsearch.Free.UserName,
+				Password: DbConf.Elasticsearch.Free.Password,
+				Size:     DbConf.Elasticsearch.Free.Size,
+			}
+			Free.Init()
 			//es.InitElasticSizeByAuth(DbConf.Elasticsearch.Other.Address, DbConf.Elasticsearch.Other.Size,
 			//	DbConf.Elasticsearch.Other.UserName, DbConf.Elasticsearch.Other.Password)
-			log.Println("初始化 Other elasticsearch")
+			log.Println("初始化 Free elasticsearch")
 		}
 
 		//初始化redis