Skip to content

Commit 6c655e2

Browse files
committed
feat: add --chunk-size flag (default: 10)
Use this flag to finetune the maximum number of metadata components to be read per API call. For example reading 10 large Profiles might time out: REQUEST_RUNNING_TOO_LONG: Your request was running for too long, and has been stopped.
1 parent cc68aa8 commit 6c655e2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/commands/force/source/read.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export class SourceReadCommand extends SfCommand<any> {
3636
summary: `comma-separated list of source file paths to retrieve
3737
Example: 'force-app/main/default/objects/Account/recordTypes/Business.recordType-meta.xml,force-app/main/default/profiles/Admin.profile-meta.xml'`,
3838
}),
39+
"chunk-size": Flags.integer({
40+
summary: "number of components to be read per API call",
41+
description: "The limit for readMetadata() is 10. For CustomMetadata and CustomApplication only, the limit is 200.",
42+
max: 10,
43+
default: 10
44+
})
3945
};
4046

4147
public static readonly requiresProject = true;
@@ -64,7 +70,7 @@ export class SourceReadCommand extends SfCommand<any> {
6470
const chunkSize =
6571
typeName === "CustomApplication" || typeName === "CustomMetadata"
6672
? 200
67-
: 10;
73+
: flags["chunk-size"];
6874
for (const chunkOfMemberNames of chunk(typeMember.members, chunkSize)) {
6975
const componentNames = chunkOfMemberNames.map(
7076
(memberName) => `${typeName}:${memberName}`

0 commit comments

Comments
 (0)