Skip to content
Back

account.get() takes too much time to give response in android studio.

  • 0
  • Android
Shubham
18 Aug, 2023, 07:33

account.get() takes too much time to give response in android studio.

TL;DR
The user is experiencing slow response time when using the `account.get()` function in Android Studio with Appwrite Cloud. They are unsure about the location of the cloud and are asked to specify their location. It is suggested to log the time before and after the request to determine how long is "too long". The user's code is also provided. The possible cause of the issue could be the daily backup of Appwrite Cloud. No solution is offered in the given thread.
safwan
18 Aug, 2023, 08:16

Can you show your code? What version of Appwrite?

safwan
18 Aug, 2023, 08:17

It's possible that Appwrite Cloud is undergoing it's daily backup, which might be causing the issue

Shubham
18 Aug, 2023, 11:25

i am using appwrite cloud

Shubham
18 Aug, 2023, 11:26

this is my code

Shubham
18 Aug, 2023, 11:26

suspend fun getUser(): Resource<User<Map<String,Any>>?> { return withContext(Dispatchers.IO) { try { val response = account.get() Resource.Success(response)

TypeScript
        }catch (e:AppwriteException){
            if(e.type.equals("general_unauthorized_scope")){
                Resource.Success(null)
            }else{
                Resource.Error(e.message ?: "An error occurred")
            }

        }
        catch (e: Exception) {
            Resource.Error(e.message ?: "An error occurred")
        }
    }
}
Drake
18 Aug, 2023, 14:22

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

Drake
18 Aug, 2023, 14:23

Are you connecting to Appwrite cloud? If so, where are you located?

How long is too long? Maybe you can log the time before and after the request?

Shubham
18 Aug, 2023, 15:28

how will i know cloud location ?

Drake
18 Aug, 2023, 15:42

im asking you where you are located. Appwrite Cloud is currently in frankfurt

Shubham
18 Aug, 2023, 16:02

India

Shubham
18 Aug, 2023, 16:03

so thats why it takes so much time according to self hosting

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more