Skip to content

Commit

Permalink
Fix logging on more than 5 retries
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Jan 31, 2025
1 parent a6b8abb commit c389573
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/jsMain/kotlin/net/kautler/github/action/setup_wsl/Retry.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2024-2025 Björn Kautler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.kautler.github.action.setup_wsl

import actions.core.debug
Expand All @@ -8,7 +24,7 @@ internal suspend inline fun <T> retry(amount: Int, crossinline block: suspend ()
runCatching {
return block()
}.onFailure {
if (i != 5) {
if (i != amount) {
debug(it.stackTraceToString())
info("Failure happened, retrying (${it.message ?: it})")
}
Expand Down

0 comments on commit c389573

Please sign in to comment.