Skip to content

Commit

Permalink
Improve functions cold starts
Browse files Browse the repository at this point in the history
  • Loading branch information
gewfy committed Feb 7, 2023
1 parent 32d1ba3 commit d2b55fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion functions/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 d2b55fb

Please sign in to comment.