Skip to content
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

Update deployment check time limit #462

Merged
merged 3 commits into from May 13, 2020
Merged

Conversation

jonnydawg
Copy link
Collaborator

subtract 5s from time-limit;bump version

Subtracts 5s from the time limit to ensure that the check reports its last stage before timing out.
Bumps the version up a patch number.

cmd/deployment-check/input.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@joshulyne joshulyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines -53 to +54
// Calculate check run duration from the deadline and now
deadline, err := strconv.Atoi(unixDeadline)
if err != nil {
log.Fatalln("Failed to parse unix deadline from environment.")
}
if deadline > 0 {
log.Println("Parsed check deadline time from the environment:", deadline)
timeLimit = time.Duration((int64(deadline) - time.Now().Unix()) * 1e9) // Multiply by 1,000,000,000 because that's how many nanoseconds are in a second
}
timeLimit = timeDeadline.Sub(time.Now().Add(time.Second * 5))
log.Println("Check time limit set to:", timeLimit)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better!

@integrii integrii merged commit 99ad952 into master May 13, 2020
@integrii integrii deleted the deployment-check-patch4 branch June 5, 2020 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants