PhoneRistrettoCache creates an in-memory *ristretto.Cache[string, *entities.Phone]
()
| 1759 | |
| 1760 | // PhoneRistrettoCache creates an in-memory *ristretto.Cache[string, *entities.Phone] |
| 1761 | func (container *Container) PhoneRistrettoCache() *ristretto.Cache[string, *entities.Phone] { |
| 1762 | if container.phoneRistrettoCache != nil { |
| 1763 | return container.phoneRistrettoCache |
| 1764 | } |
| 1765 | container.logger.Debug(fmt.Sprintf("creating %T", container.phoneRistrettoCache)) |
| 1766 | ristrettoCache, err := ristretto.NewCache[string, *entities.Phone](&ristretto.Config[string, *entities.Phone]{ |
| 1767 | MaxCost: 5000, |
| 1768 | NumCounters: 5000 * 10, |
| 1769 | BufferItems: 64, |
| 1770 | }) |
| 1771 | if err != nil { |
| 1772 | container.logger.Fatal(stacktrace.Propagate(err, "cannot create phone ristretto cache")) |
| 1773 | } |
| 1774 | container.phoneRistrettoCache = ristrettoCache |
| 1775 | return container.phoneRistrettoCache |
| 1776 | } |
| 1777 | |
| 1778 | // UserRistrettoCache creates an in-memory *ristretto.Cache[string, entities.AuthContext] |
| 1779 | func (container *Container) UserRistrettoCache() *ristretto.Cache[string, entities.AuthContext] { |
no test coverage detected