Skip to content

Commit 74a3cdd

Browse files
fix: add wait to retrieve, move min wait and default wait to static members
1 parent b1d8b82 commit 74a3cdd

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/commands/force/source/deploy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { SourceDeployResult } from '@salesforce/source-deploy-retrieve';
1212
import { Duration } from '@salesforce/kit';
1313
import { asString } from '@salesforce/ts-types';
1414
import * as chalk from 'chalk';
15-
import { DEFAULT_SRC_WAIT_MINUTES, MINIMUM_SRC_WAIT_MINUTES, SourceCommand } from '../../../sourceCommand';
15+
import { SourceCommand } from '../../../sourceCommand';
1616

1717
Messages.importMessagesDirectory(__dirname);
1818
const messages = Messages.loadMessages('@salesforce/plugin-source', 'deploy');
@@ -30,8 +30,8 @@ export class deploy extends SourceCommand {
3030
}),
3131
wait: flags.minutes({
3232
char: 'w',
33-
default: Duration.minutes(DEFAULT_SRC_WAIT_MINUTES),
34-
min: Duration.minutes(MINIMUM_SRC_WAIT_MINUTES),
33+
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
34+
min: Duration.minutes(SourceCommand.MINIMUM_SRC_WAIT_MINUTES),
3535
description: messages.getMessage('flags.wait'),
3636
}),
3737
testlevel: flags.enum({

src/commands/force/source/retrieve.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { SourceRetrieveResult } from '@salesforce/source-deploy-retrieve';
1212
import { Duration } from '@salesforce/kit';
1313
import { asString } from '@salesforce/ts-types';
1414
import { blue, yellow } from 'chalk';
15-
import { DEFAULT_SRC_WAIT_MINUTES, MINIMUM_SRC_WAIT_MINUTES, SourceCommand } from '../../../sourceCommand';
15+
import { SourceCommand } from '../../../sourceCommand';
1616

1717
Messages.importMessagesDirectory(__dirname);
1818
const messages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
@@ -30,8 +30,8 @@ export class retrieve extends SourceCommand {
3030
}),
3131
wait: flags.minutes({
3232
char: 'w',
33-
default: Duration.minutes(DEFAULT_SRC_WAIT_MINUTES),
34-
min: MINIMUM_SRC_WAIT_MINUTES,
33+
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
34+
min: SourceCommand.MINIMUM_SRC_WAIT_MINUTES,
3535
description: messages.getMessage('flags.wait'),
3636
}),
3737
manifest: flags.filepath({
@@ -73,7 +73,7 @@ export class retrieve extends SourceCommand {
7373
const results = await cs.retrieve(this.org.getUsername(), path.resolve(defaultPackage.path), {
7474
merge: true,
7575
// TODO: fix this once wait has been updated in library
76-
wait: 1000000,
76+
wait: (this.flags.wait as Duration).milliseconds,
7777
// TODO: implement retrieve via package name
7878
// package: options.packagenames
7979
});

src/sourceCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ export type FlagOptions = {
1717
metadata: string[];
1818
};
1919

20-
export const MINIMUM_SRC_WAIT_MINUTES = 1;
21-
export const DEFAULT_SRC_WAIT_MINUTES = 33;
22-
2320
export abstract class SourceCommand extends SfdxCommand {
21+
public static MINIMUM_SRC_WAIT_MINUTES = 1;
22+
public static DEFAULT_SRC_WAIT_MINUTES = 33;
2423
/**
2524
* will create one ComponentSet to be deployed/retrieved
2625
* will combine from all options passed in

0 commit comments

Comments
 (0)