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

time.Sleep to change to use a "wait for state" method #46

Closed
patrickcping opened this issue Feb 7, 2023 · 0 comments · Fixed by #250
Closed

time.Sleep to change to use a "wait for state" method #46

patrickcping opened this issue Feb 7, 2023 · 0 comments · Fixed by #250
Assignees
Milestone

Comments

@patrickcping
Copy link
Contributor

patrickcping commented Feb 7, 2023

Where possible, we should use a "wait for state" method to determine conditions to continue instead of time.Sleep, as we don't know what latencies we might incur on the server side

if i >= 4 {
// For new environments, need to wait for bootstrapping to complete.
// The final step is creation of the app.
if len(apps) == 0 {
tflog.Warn(ctx, "Waiting for bootstrap to complete... ")
}
i = i + 5
time.Sleep(5 * time.Second)

Example use in the PingOne provider here

The use of time.Sleep feeds into a wider discussion of use of bootstrapped configuration, where the preference is to create connections and flows explicitly from HCL code rather than depend on implicit configuration outside of the HCL dev's control

@samir-gandhi samir-gandhi added type/enhancement New feature or request and removed v0.1.1 labels Feb 24, 2023
@patrickcping patrickcping added type/housekeeping and removed type/enhancement New feature or request labels Dec 29, 2023
@patrickcping patrickcping self-assigned this Dec 29, 2023
@patrickcping patrickcping linked a pull request Jan 8, 2024 that will close this issue
@patrickcping patrickcping added this to the v0.3.0 milestone Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants