如何停止向Firebase模拟器发送请求?

时间:2020-06-24 20:31:48

标签: firebase google-cloud-platform google-cloud-firestore google-cloud-functions firebase-cli

我的项目:

Google Cloud Functions使用Scheduled Function(Pubsub + Cloud Scheduler)向第三方API发送SOAP请求,解析,清理响应并将其存储在Firestore中。已通过服务帐户进行了身份验证。

怎么了:

它已经部署并且在生产中运行良好。部署后,我安装了新的Firebase仿真器,效果很好。但是,现在它在运行Shell时总是尝试连接到仿真器(仿真器可能是问题所在):

npm run shell

在日志中,我可以看到它正在尝试连接到仿真器,但是据我了解,它应该自动绕过它们。我在解决这个问题的文档中找不到任何内容。

我的问题和日志:

有人知道如何绕过此连接尝试,以便我可以直接写入Firestore而不是仿真器吗?

以下是日志:

    [debug] [2020-06-24T20:16:37.808Z] ----------------------------------------------------------------------
[debug] [2020-06-24T20:16:37.810Z] Command:       C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\firebase-tools\lib\bin\firebase.js functions:shell
[debug] [2020-06-24T20:16:37.811Z] CLI Version:   8.4.3
[debug] [2020-06-24T20:16:37.811Z] Platform:      win32
[debug] [2020-06-24T20:16:37.811Z] Node Version:  v10.18.1
[debug] [2020-06-24T20:16:37.812Z] Time:          Wed Jun 24 2020 17:16:37 GMT-0300 (Atlantic Daylight Time)
[debug] [2020-06-24T20:16:37.812Z] ----------------------------------------------------------------------
[debug] [2020-06-24T20:16:37.812Z] 
[debug] [2020-06-24T20:16:37.822Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-06-24T20:16:37.823Z] > authorizing via signed-in user
[debug] [2020-06-24T20:16:37.823Z] [iam] checking project rtiwebservices for permissions ["firebase.projects.get"]
[debug] [2020-06-24T20:16:37.827Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/rtiwebservices:testIamPermissions  
 {"permissions":["firebase.projects.get"]}
[debug] [2020-06-24T20:16:38.208Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 24 Jun 2020 20:16:35 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=182","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-06-24T20:16:38.209Z] >>> HTTP REQUEST GET http://localhost:4400/emulators  
 
[debug] [2020-06-24T20:16:40.215Z] Error: connect ECONNREFUSED 127.0.0.1:4400
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[error] 
[error] Error: Server Error. connect ECONNREFUSED 127.0.0.1:4400

0 个答案:

没有答案