MCPcopy Create free account
hub / github.com/docker/docker-agent / newIdempotencyCache

Function newIdempotencyCache

pkg/server/idempotency.go:22–30  ·  view source on GitHub ↗
(capacity int)

Source from the content-addressed store, hash-verified

20}
21
22func newIdempotencyCache(capacity int) *idempotencyCache {
23 if capacity <= 0 {
24 capacity = defaultIdempotencyCapacity
25 }
26 return &idempotencyCache{
27 capacity: capacity,
28 set: make(map[string]struct{}),
29 }
30}
31
32// reserve records key and reports whether it had already been seen. The
33// check-and-record is atomic so concurrent retries with the same key resolve

Calls

no outgoing calls