Change out usync.Locker for usync.Monitor

This commit is contained in:
Sasha Koshka 2025-02-05 21:45:12 -05:00
parent fe5be15ee6
commit 22ad9ccec5
2 changed files with 3 additions and 3 deletions

View File

@ -27,13 +27,13 @@ type Environment struct {
// environment, as well as any providers that are loaded.
Config Meta
documents usync.Locker[map[string] *Document]
documents usync.Monitor[map[string] *Document]
funcMap template.FuncMap
}
// Init must be called before utilizng the environment.
func (this *Environment) Init (ctx context.Context) error {
this.documents = usync.NewLocker(make(map[string] *Document))
this.documents = usync.NewMonitor(make(map[string] *Document))
this.funcMap = make(template.FuncMap)
for _, provider := range this.Providers {
if provider, ok := provider.(ConfigProcessor); ok {

View File

@ -41,7 +41,7 @@ type Handler struct {
TrustXForwardedFor bool
TrustCFConnectingIP bool
rateLimitMap usync.Locker[map[string] rateLimitEntry]
rateLimitMap usync.Monitor[map[string] rateLimitEntry]
}
func (this *Handler) Init (ctx context.Context) error {