我在Android上使用Firebase Cloud Functions库,并使用getHttpsCallable调用云功能.
问题是函数需要10-15秒才能将结果返回给客户端,因此客户端会抛出异常java.net.SocketTimeoutException: timeout.
码
// Create the arguments to the callable function.
Map<String, Object> data = new HashMap<>();
data.put("info", info);
mFunctions.getHttpsCallable(function)
.call(data)
.continueWith(new Continuation<HttpsCallableResult, String>() {
@Override
public String then(@NonNull Task<HttpsCallableResult> task) {
// This continuation runs on either success or failure, but if the task
// has failed then getResult() will throw an Exception which will be
// propagated down.
if (task.isSuccessful()) {
String result = (String) task.getResult().getData();
Log.v(Constants.LOG_TAG, result);
return result;
} …Run Code Online (Sandbox Code Playgroud) 我是TensorFlow和数据科学的新手。我做了一个简单的模块,应该弄清楚输入和输出数字之间的关系。在这种情况下,x和x平方。Python中的代码:
import numpy as np
import tensorflow as tf
# TensorFlow only log error messages.
tf.logging.set_verbosity(tf.logging.ERROR)
features = np.array([-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10], dtype = float)
labels = np.array([100, 81, 64, 49, 36, 25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25, 36, 49, 64,
81, 100], dtype = float)
model = tf.keras.Sequential([
tf.keras.layers.Dense(units = 1, input_shape = [1])
])
model.compile(loss = …Run Code Online (Sandbox Code Playgroud) 我从Firebase Docs了解 Auth API 配额。我想知道超过这些配额后会发生什么?我会被收取更多费用吗?或者身份验证功能是否会停止,直到超过限制?
我在我的项目中使用Firebase Cloud Functions,并且我有很多它们,因此当我运行常规时,firebase deploy我超出了配额,因此一种选择是仅部署通过使用此网页firebase deploy --only functions:function1中提到的方式修改的功能。此方法仅适用于以以下开头的函数:但是当我尝试将它与这样的函数一起使用时:exports.funcName
function doesNotStartWithExports() {\n // Does something.\n}\nRun Code Online (Sandbox Code Playgroud)\n\n它不起作用。我使用firebase deploy --only functions:doesNotStartWithExports但我得到这个输出:
\xe2\x9a\xa0 functions: the following filters were specified but do not match any functions in the project: doesNotStartWithExports\nRun Code Online (Sandbox Code Playgroud)\n\n问题:如何部署不以导出开头的 Firebase 函数?
\nfirebase ×3
android ×1
firebase-cli ×1
java ×1
keras ×1
networking ×1
python ×1
quota ×1
tensorflow ×1