Don't create an unnecessary array in conversation batcher
This commit is contained in:

committed by
Scott Nonnenberg

parent
805eab6878
commit
e77dcf7f85
@@ -879,10 +879,10 @@ export async function startApp(): Promise<void> {
|
|||||||
const changedConvoBatcher = createBatcher<ConversationModel>({
|
const changedConvoBatcher = createBatcher<ConversationModel>({
|
||||||
name: 'changedConvoBatcher',
|
name: 'changedConvoBatcher',
|
||||||
processBatch(batch) {
|
processBatch(batch) {
|
||||||
const deduped = Array.from(new Set(batch));
|
const deduped = new Set(batch);
|
||||||
window.log.info(
|
window.log.info(
|
||||||
'changedConvoBatcher: deduped ' +
|
'changedConvoBatcher: deduped ' +
|
||||||
`${batch.length} into ${deduped.length}`
|
`${batch.length} into ${deduped.size}`
|
||||||
);
|
);
|
||||||
|
|
||||||
deduped.forEach(conversation => {
|
deduped.forEach(conversation => {
|
||||||
|
Reference in New Issue
Block a user