v1.3.2 fix cfg bug
This commit is contained in:
		
							parent
							
								
									4ce4df224c
								
							
						
					
					
						commit
						89b9506902
					
				
							
								
								
									
										2
									
								
								cache.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								cache.go
									
									
									
									
									
								
							@ -63,7 +63,6 @@ type Config struct {
 | 
				
			|||||||
func NewCache[T any](getter Getter[T], cfg Config) Cacher[T] {
 | 
					func NewCache[T any](getter Getter[T], cfg Config) Cacher[T] {
 | 
				
			||||||
	var c = new(cacher[T])
 | 
						var c = new(cacher[T])
 | 
				
			||||||
	// Getter
 | 
						// Getter
 | 
				
			||||||
	c.cfg = cfg
 | 
					 | 
				
			||||||
	c.getter = getter
 | 
						c.getter = getter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Local cache
 | 
						// Local cache
 | 
				
			||||||
@ -100,6 +99,7 @@ func NewCache[T any](getter Getter[T], cfg Config) Cacher[T] {
 | 
				
			|||||||
		cfg.UseExpiredCache = &[]bool{true}[0]
 | 
							cfg.UseExpiredCache = &[]bool{true}[0]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						c.cfg = cfg
 | 
				
			||||||
	name := reflect.TypeOf(*new(T)).String()
 | 
						name := reflect.TypeOf(*new(T)).String()
 | 
				
			||||||
	log.PrintPretty("new cache '"+name+"' by config:", cfg)
 | 
						log.PrintPretty("new cache '"+name+"' by config:", cfg)
 | 
				
			||||||
	return c
 | 
						return c
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user