-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a batchSize and applying extrinsics per batch #2728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be applied to all extrinsic methods not only canceling contracts. I suggest it to be done in utility methods (batch, batchAll) here
@@ -12,21 +12,37 @@ class Utility { | |||
@checkConnection | |||
async batch<T>(extrinsics: ExtrinsicResult<T>[]): Promise<T[]> { | |||
extrinsics = extrinsics.filter(Boolean); | |||
const batchSize = 400; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this constant outside the method to be global in this module
@@ -323,6 +323,7 @@ class TFContracts extends Contracts { | |||
extrinsics.push(await this.cancel({ id })); | |||
} | |||
await this.client.applyAllExtrinsics(extrinsics); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maayarosama remove this file as it got no changes
Description
Adding a batch size to batchCancelContracts method. so instead of canceling all contracts at once, they get canceled in batches
Changes
Related Issues
Checklist