(key string, fn func() (interface{}, error))
| 376 | } |
| 377 | |
| 378 | func (g *orderedFlightGroup) Do(key string, fn func() (interface{}, error)) (interface{}, error) { |
| 379 | <-g.stage1 |
| 380 | <-g.stage2 |
| 381 | g.mu.Lock() |
| 382 | defer g.mu.Unlock() |
| 383 | return g.orig.Do(key, fn) |
| 384 | } |
| 385 | |
| 386 | // TestNoDedup tests invariants on the cache size when singleflight is |
| 387 | // unable to dedup calls. |