Skip to content

Commit

Permalink
Improve functions cold starts (#1751)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewfy committed Feb 9, 2023
2 parents 2b0b7d4 + d2b55fb commit 12ea15a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion functions/src/index.ts
@@ -1,5 +1,11 @@
import * as admin from 'firebase-admin';
admin.initializeApp();
import * as firestore from 'firebase-admin/firestore';

/* This should improve cold starts, no emulator support yet though
https://github.com/firebase/firebase-admin-node/pull/1901 */
firestore.initializeFirestore(admin.initializeApp(), {
preferRest: !process.env.FUNCTIONS_EMULATOR,
});

export * from './api';
export * from './slack';
Expand Down

0 comments on commit 12ea15a

Please sign in to comment.