完成所有交易后,如何正确退出firebase-admin nodejs脚本 [英] How to properly exit firebase-admin nodejs script when all transaction is completed
问题描述
无论如何,是否需要在firebase-admin nodejs脚本中检查所有firebase事务是否已完成,并正确断开与firebase的连接并退出nodejs脚本?
Is there anyway to check if all firebase transaction is completed in firebase-admin nodejs script, and properly disconnect from firebase and exit the nodejs script?
当前,即使所有事务都已完成,firebase-admin nodejs脚本也将保持运行状态.
Currently, the firebase-admin nodejs script will just keep running even after all the transaction has been completed.
推荐答案
如果您跟踪所有的诺言并成功完成,则说明该应用程序保持了连接打开状态,您可以终止该应用程序,通过使用:
If you're keeping track of all the promises and they complete successfully, what's happening is that the app is keeping a connection open, you can kill the app, by using:
app.delete()
例如,如果您使用默认应用程序,则可以执行以下操作:
For example if you used the default app you can do this:
firebase.app().delete()
这篇关于完成所有交易后,如何正确退出firebase-admin nodejs脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!