keysync
keysync copied to clipboard
Avoid unneeded work when multiple API syncs are requested
If two API requests come in to sync at the same time, we shouldn't sync twice. This is made a bit easier because we serialize syncs on a lock.
I'm thinking we do something like have a request queue, and new requests can be merged into pending ones if they're overlapping.
This is probably a pretty minor optimization but may increase complexity a lot. Not 100% sure it's worth it (at least not yet)
I'm thinking of a case where the server is overloaded and sync requests are backing up -- if we can avoid doing them, that can help the server overload in addition to returning to the client faster.