recursecenter / pairing-bot

A Zulip bot that partners people for pair programming practice
MIT License
22 stars 15 forks source link

fix: Use one Firestore connection pool for all collections #68

Closed jdkaplan closed 2 months ago

jdkaplan commented 2 months ago

The Firestore client maintains its own internal gRPC connection pool and allows for its methods to be called concurrently. So we should be able to create just one client and reuse it everywhere we run Firestore queries.

Before, we were creating one client per collection, but all of them have identical configuration. From a quick skim through history, I don't think this was done for any isolation or performance reasons, and most endpoints access multiple collections anyway. So I want to try simplifying app startup by having just the one client.

Testing

I'll manually trigger a pairing job in the dev project and send the test bot some config requests.