You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why my Firebase cloud functions are slow. I have tested a simple function and it takes more than 1 second every time.
this is my code in Kotlin:
coroutineScope.launch(Dispatchers.IO) {
val timeTaken = measureTimeMillis {
currentAndroidVersion =
loginViewModel.repo.checkAndroidVersion(lastUpdateDate)
}
println("checkAndroidVersion took $timeTaken ms to execute")
}
this usually prints:
checkAndroidVersion took 1394 ms to execute
checkAndroidVersion took 1028 ms to execute
KMM repo:
val functions = Firebase.functions("europe-central2")
suspend fun checkAndroidVersion(version: String): String{
return functions.httpsCallable("checkAndroidVersion").invoke(version).data<String>()
}
cloud function:
exports.checkAndroidVersion =
onCall({region: "europe-central2"}, (request) => {
logger.info("current user version = "+request.data, {structuredData: true});
const version = request.data;
if (version != "15/10/2024") {
return version;
}
return "updated";
});
Why my Firebase cloud functions are slow. I have tested a simple function and it takes more than 1 second every time.
this is my code in Kotlin:
this usually prints:
KMM repo:
cloud function:
these are my dependencies:
The text was updated successfully, but these errors were encountered: