尝试给上报到elasticsearch的文档加_id
This commit is contained in:
		
							parent
							
								
									46a2136617
								
							
						
					
					
						commit
						d55afe2b85
					
				@ -284,14 +284,14 @@ func (core *Core) SaveUniKey(period string, keyName string, extt time.Duration,
 | 
			
		||||
	did := cl.InstId + cl.Period + cl.Data[0].(string)
 | 
			
		||||
	cl.Id = hashString(did)
 | 
			
		||||
	cl.ToStruct(core)
 | 
			
		||||
	// cd, _ := json.Marshal(cl)
 | 
			
		||||
	// wg := WriteLog{
 | 
			
		||||
	// 	Content: cd,
 | 
			
		||||
	// 	Tag:     "sardine.log.candle." + cl.Period,
 | 
			
		||||
	// 	Id:      hashString(did),
 | 
			
		||||
	// }
 | 
			
		||||
	cd, _ := json.Marshal(cl)
 | 
			
		||||
	wg := WriteLog{
 | 
			
		||||
		Content: cd,
 | 
			
		||||
		Tag:     "sardine.log.candle." + cl.Period,
 | 
			
		||||
		Id:      hashString(did),
 | 
			
		||||
	}
 | 
			
		||||
	// go func() {
 | 
			
		||||
	// core.WriteLogChan <- &wg
 | 
			
		||||
	core.WriteLogChan <- &wg
 | 
			
		||||
	// }()
 | 
			
		||||
	// err = wg.Process(core)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -112,6 +112,7 @@ func (core *Core) Init() {
 | 
			
		||||
	cli, err := core.GetRedisCli()
 | 
			
		||||
	core.RedisCli = cli
 | 
			
		||||
	core.RestQueueChan = make(chan *RestQueue)
 | 
			
		||||
	core.WriteLogChan = make(chan *WriteLog)
 | 
			
		||||
	core.OrderChan = make(chan *private.Order)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Println("init redis client err: ", err)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user