MCPcopy Create free account
hub / github.com/PostHog/duckgres / NewCacheProxy

Function NewCacheProxy

cmd/cache-proxy/proxy.go:112–123  ·  view source on GitHub ↗
(store *DiskCache, peers *PeerManager, cacheHostSuffixes []string)

Source from the content-addressed store, hash-verified

110}
111
112type call struct {
113 wg sync.WaitGroup
114 start time.Time
115 res fetchResult
116 err error
117}
118
119func (sf *singleFlight) Do(key string, fn func() (fetchResult, error)) (fetchResult, error) {
120 sf.mu.Lock()
121 if sf.m == nil {
122 sf.m = make(map[string]*call)
123 }
124 if c, ok := sf.m[key]; ok {
125 sf.mu.Unlock()
126 c.wg.Wait()

Callers 2

newTestProxyFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

newTestProxyFunction · 0.68