我一获取URL就能看到新条目被添加了,但是请求却挂起并超时。为什么呢?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.add = functions.https.onRequest((request, response)=>
{
var ref = admin.database().ref("jobs");
var childRef = ref.push();
childRef.set
(
{
title: "test",
pay: 100
}
);
})
代码基于以下示例:https://firebase.google.com/docs/database/admin/save-data 结果
{"error":{"code":500,"status":"INTERNAL","message":"function execution attempt timed out"}}