Import bridges into BridgeDB in a separate thread and database transaction
Last week, kaner briefly mentioned that BridgeDB doesn't accept client connections during startup. I then asked aagbsn whether he can look at the relevant code parts to see if this also applies to reloading bridges, which happens twice an hour. He said it does.
To be clear: if BridgeDB takes 1 minute to load bridges (20K bridges on aagbsn's linode VM, 8K bridges on my desktop machine), it won't give out any bridges to clients for 2 minutes per hour. That's a maximum availability of 96.6 %. This is going to get worse the more bridges we add.
aagbsn and I think that we could make BridgeDB import bridges in a separate thread and in a single database transaction. There should probably be a check that it doesn't serve too old bridges (e.g., not more than a few hours old) during startup if it hasn't run for a while.