UNPKG

@aws-lambda-powertools/idempotency

Version:

The idempotency package for the Powertools for AWS Lambda (TypeScript) library. It provides options to make your Lambda functions idempotent and safe to retry.

26 lines (25 loc) 881 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MAX_RETRIES = exports.IdempotencyRecordStatus = void 0; /** * Number of times to retry a request in case of `IdempotencyInconsistentStateError` * * Used in `IdempotencyHandler` and `makeHandlerIdempotent` * * @internal */ const MAX_RETRIES = 2; exports.MAX_RETRIES = MAX_RETRIES; /** * Idempotency record status. * * A record is created when a request is received. The status is set to `INPROGRESS` and the request is processed. * After the request is processed, the status is set to `COMPLETED`. If the request is not processed within the * `inProgressExpiryTimestamp`, the status is set to `EXPIRED`. */ const IdempotencyRecordStatus = { INPROGRESS: 'INPROGRESS', COMPLETED: 'COMPLETED', EXPIRED: 'EXPIRED', }; exports.IdempotencyRecordStatus = IdempotencyRecordStatus;