InMemoryCache returns the shared in-memory cache.Cache, creating it on the first call.
()
| 431 | |
| 432 | // InMemoryCache returns the shared in-memory cache.Cache, creating it on the first call. |
| 433 | func (container *Container) InMemoryCache() cache.Cache { |
| 434 | if container.inMemoryCache != nil { |
| 435 | return container.inMemoryCache |
| 436 | } |
| 437 | container.logger.Debug("creating an in memory cache") |
| 438 | c := ttlCache.New(time.Hour, time.Hour*2) |
| 439 | container.inMemoryCache = cache.NewMemoryCache(container.Tracer(), c) |
| 440 | return container.inMemoryCache |
| 441 | } |
| 442 | |
| 443 | // Cache creates a new instance of cache.Cache |
| 444 | func (container *Container) Cache() cache.Cache { |
no test coverage detected