Skip to content

Commit

Permalink
feat: add timeout for handler
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 20, 2023
1 parent 743bbb7 commit 687b04a
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@ import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import java.time.Duration


@Serializable
Expand All @@ -46,7 +47,8 @@ class AzureOpenAIProvider(val project: Project) : LLMProvider {
private val autoDevSettingsState = AutoDevSettingsState.getInstance()
private val url get() = autoDevSettingsState.customOpenAiHost
private var customPromptConfig: CustomPromptConfig? = null
private var client = OkHttpClient()
private val timeout = Duration.ofSeconds(600)
private var client = OkHttpClient().newBuilder().readTimeout(timeout).build()
private val openAiVersion: String

init {
Expand Down

0 comments on commit 687b04a

Please sign in to comment.