Shreyas arya

Generation

generate functionThu, 09 Feb 2023

When requests to Step Function fail, Workflow Service performs exponential backoff retries to notify Step Function service. Number of retries = 3 The total duration of all attempts doesn't exceed 10 seconds, the processing must not exceed the message visibility timeout.

Script const WAIT_BETWEEN_RETRIES_IN_SECONDS = 1; const NUMBER_OF_RETRIES = 3; const MAX_DURATION = 10; const numberOfRetries = Math.min(Math.ceil(Math.log2(MAX_DURATION)), NUMBER_OF_RETRIES); var delay = WAIT_BETWEEN_RETRIES_IN_SECONDS * Math.pow(2, numberOfRetries); return callback(null, { delay: delay, numberOfRetries: numberOfRetries });

Questions about programming?Chat with your personal AI assistant