Skip to content

Commit 7ad924b

Browse files
committed
Limit processing to maximum defined by maxActionsProcessing
1 parent 848e70a commit 7ad924b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/client-twitter/src/post.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -627,11 +627,12 @@ export class TwitterPostClient {
627627

628628
const homeTimeline = await this.client.fetchTimelineForActions();
629629
const results = [];
630-
let maxActionsProcessing =
630+
let count = 0;
631+
const maxActionsProcessing =
631632
this.client.twitterConfig.MAX_ACTIONS_PROCESSING;
632633

633634
for (const tweet of homeTimeline) {
634-
if (maxActionsProcessing >= 2) {
635+
if (count >= maxActionsProcessing) {
635636
break;
636637
}
637638
try {
@@ -925,7 +926,7 @@ export class TwitterPostClient {
925926
parsedActions: actionResponse,
926927
executedActions,
927928
});
928-
maxActionsProcessing++;
929+
count++;
929930
} catch (error) {
930931
elizaLogger.error(
931932
`Error processing tweet ${tweet.id}:`,

0 commit comments

Comments
 (0)