-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
creates a sqs queue for retry failed scale-up requests #1947
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
terraform-aws-github-runner/modules/runners/lambdas/runners/src/lambda.ts
Show resolved
Hide resolved
for (const evt of evtFailed) { | ||
const body: ActionRequestMessage = JSON.parse(evt.body); | ||
const retryCount = body?.retryCount ?? 0; | ||
const delaySeconds = Math.max(body?.delaySeconds ?? Config.Instance.retryScaleUpRecordDelayS / 2, 10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit.
The delay calculation formula looks a bit confusing. I'd rewrite it in a more explicit manner, like:
if (body.delaySeconds === null) {
body.delaySeconds = Config.Instance.retryScaleUpRecordDelayS;
} else {
body.delaySeconds *= 2;
}
body.delaySeconds = Math.max(body.delaySeconds, 10);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, much more readable this way
terraform-aws-github-runner/modules/runners/lambdas/runners/src/lambda.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good. I'd appreciate the answer to this question, but, in any case, the change should work.
No description provided.