Loading documentation…
Loading documentation…
Refresh inventories predictably while limiting duplicate work.
Use a single-flight or lease around each inventory refresh, cache successful snapshots, and apply bounded retry behaviour.
Complete Build an inventory integration first. Decide which component owns scheduling, the maximum acceptable snapshot age, and whether your product may serve a labelled stale snapshot.
Define separate values for retrieval time, acceptable freshness, and maximum stale-serving duration. Publish a new snapshot only when the paginated read completes.
The coordination mechanism must expire after a crashed worker. A waiting request should use the current snapshot or return a clear in-progress state rather than starting unbounded duplicate work.
Keep the last successful snapshot when a refresh is private, rate limited, unavailable, or incomplete. Record the refresh outcome separately. Retry only transient outcomes and stop when the workflow deadline or attempt cap is reached.
Track snapshot age, refresh duration, page count, outcome, and request IDs. Do not attach API keys or full inventory payloads to metrics, traces, or alerts. Review Retries & timeouts and Caching.