Deploy Node.js on Google app engine, running twice

2019-09-14 20:45发布

I wrote a small app server that I want it to keep listening on the change of the firebase database. So I tried to deploy the app on Google app engine, but the code in server ran twice. Then I checked the log of that particular app engine instance. Seems like it ran the app server twice.

App engine's log image:

1

I couldn't find a way to fix this, help! Thanks in advance!

2条回答
放荡不羁爱自由
2楼-- · 2019-09-14 21:07

If you want to listen to firebase changes you have two options: 1) use firebase queues to make sure that only one instance at the time take actions 2) use cloud functions

查看更多
何必那么认真
3楼-- · 2019-09-14 21:11

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.

查看更多
登录 后发表回答