account.get() takes too much time to give response in android studio.
Can you show your code? What version of Appwrite?
It's possible that Appwrite Cloud is undergoing it's daily backup, which might be causing the issue
i am using appwrite cloud
this is my code
suspend fun getUser(): Resource<User<Map<String,Any>>?> { return withContext(Dispatchers.IO) { try { val response = account.get() Resource.Success(response)
}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")
}
}
}
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
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?
how will i know cloud location ?
im asking you where you are located. Appwrite Cloud is currently in frankfurt
India
so thats why it takes so much time according to self hosting
Recommended threads
- {"code": 1008, "message": "Invalid Origi...
Nothing has changed in my application or console settings so I'm curious as to what I need to do to fix this. I already have the client registered so I'm not en...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast