[英]Deploy Node.js on Google app engine, running twice issue
I wrote a small app server that I want it to keep listening on the change of the firebase database. 我编写了一个小型应用程序服务器,希望它继续监听Firebase数据库的更改。 So I tried to deploy the app on Google app engine, but the code in server ran twice.
因此,我尝试在Google App Engine上部署该应用程序,但是服务器中的代码运行了两次。 Then I checked the log of that particular app engine instance.
然后,我检查了该特定应用引擎实例的日志。 Seems like it ran the app server twice.
好像它两次运行了应用服务器。
App engine's log image: App引擎的日志图片:
I couldn't find a way to fix this, help! 我找不到解决此问题的方法,帮助! Thanks in advance!
提前致谢!
The repeated messages typically indicate multiple instances being started. 重复的消息通常指示多个实例正在启动。 Which can be checked on the Instances page on the Developer Console, where you can also manually stop running instances.
可以在开发人员控制台的“实例”页面上进行检查,也可以在此处手动停止运行实例。
But you also need to check the service scaling settings in your app.yaml
file as that's what controls the automatic starting of instances. 但是,您还需要检查
app.yaml
文件中的服务扩展设置 ,因为这是控制实例自动启动的因素。
如果您想聆听Firebase的更改,则有两个选择:1)使用Firebase队列以确保当时只有一个实例执行操作2)使用云功能
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.