Skip to content

Leverage setInterval vs setTimeout for Firestore connection check #99

@pattishin

Description

@pattishin

Original conversation: https://github.com/GoogleCloudPlatform/developer-journey-app/pull/97/files/19346d493c193f9ff6c630de1a126929b240f49d#r1275425395

Ref: src/lib/database.ts -> isConnected()

Request to use setInterval over Promise.race and setTimeout (in src/lib/database.ts).
It seems this.db.listCollections could be polled rather than giving it a timer for Promise.race to compete against. This could also make the isConnected function a little more efficient.

Metadata

Metadata

Assignees

Labels

javascriptPull requests that update Javascript code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions