This PR uses a queue to make loading decrypted docs into an encrypted copy faster and more efficient. Previously, each decrypted doc would be loaded into the encrypted copy one-by-one. This is very slow. Instead, we load docs into an in-memory queue from which we load documents into the database in bulk. The queue's harvest limit is 100. That is, whenever the queue exceeds 100 documents, those documents are loaded into the database and the queue is reset. At the end of loadDecrypted() any remaining docs are also loaded en masse.
This PR uses a queue to make loading decrypted docs into an encrypted copy faster and more efficient. Previously, each decrypted doc would be loaded into the encrypted copy one-by-one. This is very slow. Instead, we load docs into an in-memory queue from which we load documents into the database in bulk. The queue's harvest limit is 100. That is, whenever the queue exceeds 100 documents, those documents are loaded into the database and the queue is reset. At the end of
loadDecrypted()
any remaining docs are also loaded en masse.