Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/commands/project/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { Messages, Org, SfProject } from '@salesforce/core';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { ComponentSet, DeployResult, MetadataApiDeploy, RequestStatus } from '@salesforce/source-deploy-retrieve';
import { Duration } from '@salesforce/kit';
import { DeployStages } from '../../../utils/deployStages.js';
import { buildComponentSet } from '../../../utils/deploy.js';
import { DeployCache } from '../../../utils/deployCache.js';
Expand Down Expand Up @@ -137,7 +138,7 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
title: 'Deploying Metadata',
jsonEnabled: this.jsonEnabled(),
}).start({ deploy: mdapiDeploy, username: org.getUsername() });
result = await mdapiDeploy.pollStatus(500, wait.seconds);
result = await mdapiDeploy.pollStatus(Duration.seconds(1).milliseconds, wait.seconds);
} catch (error) {
if (error instanceof Error && error.message.includes('The client has timed out')) {
this.debug('[project deploy report] polling timed out. Requesting status...');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/deploy/resume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default class DeployMetadataResume extends SfCommand<DeployResultJson> {
}
);

result = await deploy.pollStatus(500, wait.seconds);
result = await deploy.pollStatus(Duration.seconds(1).milliseconds, wait.seconds);

if (!deploy.id) {
throw new SfError('The deploy id is not available.');
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/deploy/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class DeployMetadataValidate extends SfCommand<DeployResultJson>
}
);

const result = await deploy.pollStatus(500, flags.wait?.seconds);
const result = await deploy.pollStatus(Duration.seconds(1).milliseconds, flags.wait?.seconds);
process.exitCode = determineExitCode(result);
const formatter = new DeployResultFormatter(result, {
...flags,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/retrieve/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
throw error;
});

this.retrieveResult = await retrieve.pollStatus(500, flags.wait.seconds);
this.retrieveResult = await retrieve.pollStatus(Duration.seconds(1).milliseconds, flags.wait.seconds);
}

this.ms.stop();
Expand Down
2 changes: 1 addition & 1 deletion src/utils/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export async function cancelDeploy(opts: Partial<DeployOptions>, id: string): Pr

await deploy.cancel();
return deploy.pollStatus({
frequency: Duration.milliseconds(500),
frequency: Duration.seconds(1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a minute to figure out why this did not need to be a number... I don't like this overload that takes either a frequency number or options object 😛 Also that the variables are Numbers that are converted to Duration and the option object just takes Duration. I wish we would have taken Duration everywhere.

timeout: opts.wait ?? Duration.minutes(33),
});
}
Expand Down