supabase-community / supabase-kt

A Kotlin Multiplatform Client for Supabase.
https://supabase.com/docs/reference/kotlin/introduction
MIT License
415 stars 37 forks source link

[Feature request]: need to add custom timeout #765

Closed patelabhilash closed 1 month ago

patelabhilash commented 1 month ago

General Info

Feature request

Request to add a custom timeout option, as the database currently provides a 2-minute timeout, but the client is restricting it to only 10 seconds. There is no parameter available to adjust this.

private val supabaseClient: SupabaseClient by lazy {
        createSupabaseClient(
            supabaseUrl = BuildConfig.SUPABASE_URL,
            supabaseKey = BuildConfig.SUPABASE_ANON_KEY
        ) {
            install(Postgrest)
        }
    }

Usecase

I believe the reason for requesting this is well understood. Please let me know if there is already a workaround. I’m asking because I could not find any documentation on this.

jan-tennert commented 1 month ago

There is an option:

private val supabaseClient: SupabaseClient by lazy {
        createSupabaseClient(
            supabaseUrl = BuildConfig.SUPABASE_URL,
            supabaseKey = BuildConfig.SUPABASE_ANON_KEY
        ) {
            requestTimeout = 2.minutes
            install(Postgrest)
        }
    }