GoogleCloudPlatform / GoogleCloudPlatform/developer-journey-app
Leverage `setInterval` vs `setTimeout` for Firestore connection check
Open
javascript
- Dominant language
- TypeScript
- Stars
- 36
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.