Last active
March 10, 2022 18:20
-
-
Save cezarsa/df86d501d072f7bb184daf0b541655e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ticker := time.NewTicker(time.Minute) | |
defer ticker.Stop() | |
for { | |
select { | |
case <-ticker.C: | |
// poll the image build status | |
case evt := <-webhookRequest: | |
ticker.Reset(time.Minute) | |
// update the image build status with evt | |
case <-time.After(30*time.Minute): | |
// fail on overall timeout | |
} | |
// break if image build status != pending | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment