Skip to content

Commit

Permalink
bugfix from google team! 💯
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Mar 27, 2020
1 parent a35cd11 commit 55b6893
Show file tree
Hide file tree
Showing 4 changed files with 558 additions and 15 deletions.
4 changes: 2 additions & 2 deletions benchmark-multiple-gets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require('dotenv').config()

// comment / uncomment these two lines to switch between REST and gRPC
const firestore = require('./firestore-googleapis')
// const firestore = require('./firestore-grpc')
// const firestore = require('./firestore-googleapis')
const firestore = require('./firestore-grpc')

const ids = [
'DaubZexsvlUE7beXCOEd',
Expand Down
3 changes: 2 additions & 1 deletion firestore-grpc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { Firestore } = require('@google-cloud/firestore')
const grpc = require('@grpc/grpc-js')

console.log('using gRPC via @google-cloud/firestore')
const db = new Firestore()
const db = new Firestore({ grpc })
const CronJobs = db.collection('cron-jobs')

exports.get = async function get(id) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"license": "MIT",
"main": "benchmark-single-get.js",
"dependencies": {
"@google-cloud/firestore": "^3.7.1",
"@google-cloud/firestore": "^3.7.2",
"@grpc/grpc-js": "^0.7.4",
"dotenv-safe": "^8.2.0",
"googleapis": "^48.0.0"
"googleapis": "^48.0.0",
"grpc": "^1.24.2"
}
}
Loading

0 comments on commit 55b6893

Please sign in to comment.