From ccf8f30c3fe376717963d8656bb93ab8a631bc8d Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Thu, 12 Dec 2024 15:41:46 +0000 Subject: [PATCH] :broom: Cleanup --- components/mod-event/helpers/emitEvent.tsx | 9 +++++++-- components/workspace/Panel.tsx | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/mod-event/helpers/emitEvent.tsx b/components/mod-event/helpers/emitEvent.tsx index 3c6d832..00a70dd 100644 --- a/components/mod-event/helpers/emitEvent.tsx +++ b/components/mod-event/helpers/emitEvent.tsx @@ -155,7 +155,6 @@ const emitEventsInBulk = async ({ }) results.succeeded.push(sub) } catch (err) { - console.error(err) results.failed.push(sub) } }), @@ -209,7 +208,13 @@ export const useActionSubjects = () => { failed: [], } - for (const chunk of chunkArray(subjects, 50)) { + // Emails have a lower limit per second so we want to make sure we are well below that + const chunkSize = ToolsOzoneModerationDefs.isModEventEmail( + eventData.event, + ) + ? 25 + : 50 + for (const chunk of chunkArray(subjects, chunkSize)) { const { succeeded, failed } = await emitEventsInBulk({ labelerAgent, createSubjectFromId, diff --git a/components/workspace/Panel.tsx b/components/workspace/Panel.tsx index 8cc7019..a457281 100644 --- a/components/workspace/Panel.tsx +++ b/components/workspace/Panel.tsx @@ -56,7 +56,8 @@ export function WorkspacePanel(props: PropsOf) { formRef.current?.querySelectorAll( 'input[type="checkbox"][name="workspaceItem"]:checked', ) || [], - ).map((checkbox) => checkbox.value) + (checkbox) => checkbox.value, + ) } const handleRemoveSelected = () => {