Skip to content

Commit c683569

Browse files
authored
fix: increase poll frequency to 1s W-20866289 (#1499)
* fix: increase poll frequency to 1s * chore: ci re-run
1 parent 7760eee commit c683569

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/commands/project/deploy/report.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import { Messages, Org, SfProject } from '@salesforce/core';
1818
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
1919
import { ComponentSet, DeployResult, MetadataApiDeploy, RequestStatus } from '@salesforce/source-deploy-retrieve';
20+
import { Duration } from '@salesforce/kit';
2021
import { DeployStages } from '../../../utils/deployStages.js';
2122
import { buildComponentSet } from '../../../utils/deploy.js';
2223
import { DeployCache } from '../../../utils/deployCache.js';
@@ -137,7 +138,7 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
137138
title: 'Deploying Metadata',
138139
jsonEnabled: this.jsonEnabled(),
139140
}).start({ deploy: mdapiDeploy, username: org.getUsername() });
140-
result = await mdapiDeploy.pollStatus(500, wait.seconds);
141+
result = await mdapiDeploy.pollStatus(Duration.seconds(1).milliseconds, wait.seconds);
141142
} catch (error) {
142143
if (error instanceof Error && error.message.includes('The client has timed out')) {
143144
this.debug('[project deploy report] polling timed out. Requesting status...');

src/commands/project/deploy/resume.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default class DeployMetadataResume extends SfCommand<DeployResultJson> {
154154
}
155155
);
156156

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

159159
if (!deploy.id) {
160160
throw new SfError('The deploy id is not available.');

src/commands/project/deploy/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default class DeployMetadataValidate extends SfCommand<DeployResultJson>
236236
}
237237
);
238238

239-
const result = await deploy.pollStatus(500, flags.wait?.seconds);
239+
const result = await deploy.pollStatus(Duration.seconds(1).milliseconds, flags.wait?.seconds);
240240
process.exitCode = determineExitCode(result);
241241
const formatter = new DeployResultFormatter(result, {
242242
...flags,

src/commands/project/retrieve/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
298298
throw error;
299299
});
300300

301-
this.retrieveResult = await retrieve.pollStatus(500, flags.wait.seconds);
301+
this.retrieveResult = await retrieve.pollStatus(Duration.seconds(1).milliseconds, flags.wait.seconds);
302302
}
303303

304304
this.ms.stop();

src/utils/deploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export async function cancelDeploy(opts: Partial<DeployOptions>, id: string): Pr
209209

210210
await deploy.cancel();
211211
return deploy.pollStatus({
212-
frequency: Duration.milliseconds(500),
212+
frequency: Duration.seconds(1),
213213
timeout: opts.wait ?? Duration.minutes(33),
214214
});
215215
}

0 commit comments

Comments
 (0)