Skip to content

Commit

Permalink
updated argoDeploy.groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Aug 10, 2023
1 parent 89a24c2 commit 9a5e494
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vars/argoDeploy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def call (app, timeoutMinutes=20) {
if(timeoutMinutes < 2){
error("Cannot set timeoutMinute < 2 in argoDeploy() function")
}
int timeoutSeconds = ( timeoutMinutes * 60 / numRetries ) - 10
int timeoutSeconds = ( timeoutMinutes * 60 / (numRetries + 1) ) - 10
echo "Acquiring ArgoCD Lock: $label"
lock (resource: label, inversePrecedence: true) {
// XXX: prevents calling in a parallel stage otherwise you'll get this error:
Expand All @@ -42,7 +42,9 @@ def call (app, timeoutMinutes=20) {
//container ('argocd') {
timeout (time: timeoutMinutes, unit: 'MINUTES') {

argoSync("$app")
syncTimeoutMinutes = Math.max(1, Math.ceil(timeoutSeconds / 60).toInteger() )

argoSync("$app", syncTimeoutMinutes)

// results in a timeout status, but prefer an error status to bubble up instead
//waitUntil (initialRecurrencePeriod: 5000) {
Expand Down

0 comments on commit 9a5e494

Please sign in to comment.