Skip to content

Commit 313ab19

Browse files
chore(internal): codegen related update
1 parent 7b5cd7c commit 313ab19

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

buildSrc/src/main/kotlin/lithic.java.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tasks.withType<Test>().configureEach {
4545

4646
val palantir by configurations.creating
4747
dependencies {
48-
palantir("com.palantir.javaformat:palantir-java-format:2.73.0")
48+
palantir("com.palantir.javaformat:palantir-java-format:2.89.0")
4949
}
5050

5151
fun registerPalantir(

lithic-java-core/src/main/kotlin/com/lithic/api/core/http/RetryingHttpClient.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,8 @@ private constructor(
214214
}
215215
}
216216
?.let { retryAfterNanos ->
217-
// If the API asks us to wait a certain amount of time (and it's a reasonable
218-
// amount), just
219-
// do what it says.
220-
val retryAfter = Duration.ofNanos(retryAfterNanos.toLong())
221-
if (retryAfter in Duration.ofNanos(0)..Duration.ofMinutes(1)) {
222-
return retryAfter
223-
}
217+
// If the API asks us to wait a certain amount of time, do what it says.
218+
return Duration.ofNanos(retryAfterNanos.toLong())
224219
}
225220

226221
// Apply exponential backoff, but not more than the max.

scripts/mock

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run prism mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24+
# Pre-install the package so the download doesn't eat into the startup timeout
25+
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
26+
2427
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
2528

26-
# Wait for server to come online
29+
# Wait for server to come online (max 30s)
2730
echo -n "Waiting for server"
31+
attempts=0
2832
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
33+
attempts=$((attempts + 1))
34+
if [ "$attempts" -ge 300 ]; then
35+
echo
36+
echo "Timed out waiting for Prism server to start"
37+
cat .prism.log
38+
exit 1
39+
fi
2940
echo -n "."
3041
sleep 0.1
3142
done

0 commit comments

Comments
 (0)