UserRistrettoCache creates an in-memory *ristretto.Cache[string, entities.AuthContext]
()
| 1777 | |
| 1778 | // UserRistrettoCache creates an in-memory *ristretto.Cache[string, entities.AuthContext] |
| 1779 | func (container *Container) UserRistrettoCache() *ristretto.Cache[string, entities.AuthContext] { |
| 1780 | if container.userRistrettoCache != nil { |
| 1781 | return container.userRistrettoCache |
| 1782 | } |
| 1783 | container.logger.Debug(fmt.Sprintf("creating %T", container.userRistrettoCache)) |
| 1784 | ristrettoCache, err := ristretto.NewCache[string, entities.AuthContext](&ristretto.Config[string, entities.AuthContext]{ |
| 1785 | MaxCost: 5000, |
| 1786 | NumCounters: 5000 * 10, |
| 1787 | BufferItems: 64, |
| 1788 | }) |
| 1789 | if err != nil { |
| 1790 | container.logger.Fatal(stacktrace.Propagate(err, "cannot create user ristretto cache")) |
| 1791 | } |
| 1792 | container.userRistrettoCache = ristrettoCache |
| 1793 | return ristrettoCache |
| 1794 | } |
| 1795 | |
| 1796 | // InitializeTraceProvider initializes the open telemetry trace provider |
| 1797 | func (container *Container) InitializeTraceProvider() func() { |
no test coverage detected