diff --git a/src/main/java/io/github/ollama4j/OllamaAPI.java b/src/main/java/io/github/ollama4j/OllamaAPI.java index 82f1a5a..9e53a06 100644 --- a/src/main/java/io/github/ollama4j/OllamaAPI.java +++ b/src/main/java/io/github/ollama4j/OllamaAPI.java @@ -429,7 +429,7 @@ public class OllamaAPI { return; } int numberOfRetries = 0; - long baseDelayMillis = 1000L; // 1 second base delay + long baseDelayMillis = 3000L; // 1 second base delay while (numberOfRetries < numberOfRetriesForModelPull) { try { this.doPullModel(modelName); @@ -450,8 +450,8 @@ public class OllamaAPI { int attempt = currentRetry + 1; if (attempt < maxRetries) { long backoffMillis = baseDelayMillis * (1L << currentRetry); - logger.error("Failed to pull model {}, retrying in {} ms... (attempt {}/{})", - modelName, backoffMillis, attempt, maxRetries); + logger.error("Failed to pull model {}, retrying in {} s... (attempt {}/{})", + modelName, backoffMillis/1000, attempt, maxRetries); try { Thread.sleep(backoffMillis); } catch (InterruptedException ie) { diff --git a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java index 3df94a2..494c845 100644 --- a/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java +++ b/src/test/java/io/github/ollama4j/integrationtests/OllamaAPIIntegrationTest.java @@ -75,7 +75,7 @@ class OllamaAPIIntegrationTest { } api.setRequestTimeoutSeconds(120); api.setVerbose(true); - api.setNumberOfRetriesForModelPull(3); + api.setNumberOfRetriesForModelPull(5); } @Test