Closed shreyb closed 1 year ago
https://github.com/shreyb/managed-tokens/blob/c6d2e0e65fad52f68ab573e193870626a37f1325/internal/cmdUtils/cmdUtils.go#L130
I think this whole caching mechanism can be replaced by a singleflight.Do, where the key is the collectorHost.
Package documentation: https://pkg.go.dev/golang.org/x/sync/singleflight Helpful article: https://encore.dev/blog/advanced-go-concurrency#package-singleflight
@retzkek pointed out to me that this package does not do what I think it does. Keeping things as is.
https://github.com/shreyb/managed-tokens/blob/c6d2e0e65fad52f68ab573e193870626a37f1325/internal/cmdUtils/cmdUtils.go#L130
I think this whole caching mechanism can be replaced by a singleflight.Do, where the key is the collectorHost.
Package documentation: https://pkg.go.dev/golang.org/x/sync/singleflight Helpful article: https://encore.dev/blog/advanced-go-concurrency#package-singleflight