fix memory cache Put method should set value when key exist.
This commit is contained in:
		
							parent
							
								
									42958ddd41
								
							
						
					
					
						commit
						8e8d39d3cb
					
				
							
								
								
									
										6
									
								
								cache/memory.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								cache/memory.go
									
									
									
									
										vendored
									
									
								
							| @ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error | ||||
| 		Lastaccess: time.Now(), | ||||
| 		expired:    expired, | ||||
| 	} | ||||
| 	if _, ok := bc.items[name]; ok { | ||||
| 		return errors.New("the key is exist") | ||||
| 	} else { | ||||
| 		bc.items[name] = &t | ||||
| 	} | ||||
| 	bc.items[name] = &t | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user