Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32179111
D15285.1765071616.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15285.1765071616.diff
View Options
diff --git a/lib/shared/farcaster/farcaster-hooks.js b/lib/shared/farcaster/farcaster-hooks.js
--- a/lib/shared/farcaster/farcaster-hooks.js
+++ b/lib/shared/farcaster/farcaster-hooks.js
@@ -27,6 +27,8 @@
import { useSendDMOperationUtils } from '../dm-ops/dm-op-utils.js';
import { userIDFromFID } from '../id-utils.js';
+const FARCASTER_DATA_BATCH_SIZE = 3;
+
async function processInBatches<T, R>(
items: $ReadOnlyArray<T>,
batchSize: number,
@@ -271,17 +273,20 @@
const conversationResults = await processInBatches(
conversations,
- 20,
+ FARCASTER_DATA_BATCH_SIZE,
fetchConversation,
);
farcasterConversations.push(...conversationResults.filter(Boolean));
- await processInBatches(farcasterConversations, 20, conversation =>
- fetchMessagesForConversation(
- conversation.conversationId,
- messagesNumberLimit,
- ),
+ await processInBatches(
+ farcasterConversations,
+ FARCASTER_DATA_BATCH_SIZE,
+ conversation =>
+ fetchMessagesForConversation(
+ conversation.conversationId,
+ messagesNumberLimit,
+ ),
);
setConversations([]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 1:40 AM (14 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5841994
Default Alt Text
D15285.1765071616.diff (1 KB)
Attached To
Mode
D15285: [lib] reduce batch size for Farcaster data
Attached
Detach File
Event Timeline
Log In to Comment