尝试给上报到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)
 | 
						did := cl.InstId + cl.Period + cl.Data[0].(string)
 | 
				
			||||||
	cl.Id = hashString(did)
 | 
						cl.Id = hashString(did)
 | 
				
			||||||
	cl.ToStruct(core)
 | 
						cl.ToStruct(core)
 | 
				
			||||||
	// cd, _ := json.Marshal(cl)
 | 
						cd, _ := json.Marshal(cl)
 | 
				
			||||||
	// wg := WriteLog{
 | 
						wg := WriteLog{
 | 
				
			||||||
	// 	Content: cd,
 | 
							Content: cd,
 | 
				
			||||||
	// 	Tag:     "sardine.log.candle." + cl.Period,
 | 
							Tag:     "sardine.log.candle." + cl.Period,
 | 
				
			||||||
	// 	Id:      hashString(did),
 | 
							Id:      hashString(did),
 | 
				
			||||||
	// }
 | 
						}
 | 
				
			||||||
	// go func() {
 | 
						// go func() {
 | 
				
			||||||
	// core.WriteLogChan <- &wg
 | 
						core.WriteLogChan <- &wg
 | 
				
			||||||
	// }()
 | 
						// }()
 | 
				
			||||||
	// err = wg.Process(core)
 | 
						// err = wg.Process(core)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -112,6 +112,7 @@ func (core *Core) Init() {
 | 
				
			|||||||
	cli, err := core.GetRedisCli()
 | 
						cli, err := core.GetRedisCli()
 | 
				
			||||||
	core.RedisCli = cli
 | 
						core.RedisCli = cli
 | 
				
			||||||
	core.RestQueueChan = make(chan *RestQueue)
 | 
						core.RestQueueChan = make(chan *RestQueue)
 | 
				
			||||||
 | 
						core.WriteLogChan = make(chan *WriteLog)
 | 
				
			||||||
	core.OrderChan = make(chan *private.Order)
 | 
						core.OrderChan = make(chan *private.Order)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		fmt.Println("init redis client err: ", err)
 | 
							fmt.Println("init redis client err: ", err)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user