Skip to content

Commit

Permalink
Merge 61488ab into 65bb69a
Browse files Browse the repository at this point in the history
  • Loading branch information
samtstern committed Jun 24, 2019
2 parents 65bb69a + 61488ab commit 02737f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion changelog.txt
@@ -1,2 +1,3 @@
* Fixes a bug where the functions emulator did not work with `firebase-functions` versions `3.x.x`.
* Make the Functions emulator automatically point to the RTDB emulator when running.
* Make the Functions emulator automatically point to the RTDB emulator when running.
* Fixes issue where the functions runtime would not always exit on success (#1346).
12 changes: 8 additions & 4 deletions src/emulator/functionsEmulatorRuntime.ts
Expand Up @@ -959,8 +959,12 @@ async function main(): Promise<void> {
}

if (require.main === module) {
main().catch((err) => {
new EmulatorLog("FATAL", "runtime-error", err.stack ? err.stack : err).log();
process.exit();
});
main()
.then(() => {
process.exit(0);
})
.catch((err) => {
new EmulatorLog("FATAL", "runtime-error", err.stack ? err.stack : err).log();
process.exit(1);
});
}

0 comments on commit 02737f9

Please sign in to comment.