Skip to content

Commit ef592ef

Browse files
committed
fix: disable mso timers on async
1 parent c3e57e1 commit ef592ef

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/commands/data-seeding/generate.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ export default class DataSeedingGenerate extends SfCommand<DataSeedingGenerateRe
7676

7777
// TODO: Cache the jobId so that it can be used by the `--use-most-recent` flag
7878

79-
const mso = getSeedGenerateMso(this.jsonEnabled());
80-
mso.updateData({ jobId, sourceOrg, targetOrg });
81-
8279
if (wait && !async) {
80+
const mso = getSeedGenerateMso({ jsonEnabled: this.jsonEnabled() });
81+
mso.updateData({ jobId, sourceOrg, targetOrg });
82+
8383
const options: PollingClient.Options = {
8484
poll: async (): Promise<StatusResult> => {
8585
const response = await pollSeedStatus(jobId);
@@ -140,9 +140,18 @@ export default class DataSeedingGenerate extends SfCommand<DataSeedingGenerateRe
140140
} else {
141141
const response = await pollSeedStatus(jobId);
142142

143+
const mso = getSeedGenerateMso({
144+
jsonEnabled: this.jsonEnabled(),
145+
showElapsedTime: false,
146+
showStageTime: false
147+
});
148+
143149
mso.goto(response.step);
144150

145151
mso.updateData({
152+
jobId,
153+
sourceOrg,
154+
targetOrg,
146155
startTime: response.execution_start_time,
147156
status: 'Initiated'
148157
})

src/utils/mso.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { MultiStageOutput } from '@oclif/multi-stage-output';
8+
import { MultiStageOutput, MultiStageOutputOptions } from '@oclif/multi-stage-output';
99
import { StandardColors } from '@salesforce/sf-plugins-core';
1010

1111
type SeedGenerateMsoData = {
@@ -17,7 +17,7 @@ type SeedGenerateMsoData = {
1717
status?: string;
1818
};
1919

20-
export const getSeedGenerateMso = (jsonEnabled: boolean = false) => new MultiStageOutput<SeedGenerateMsoData>({
20+
export const getSeedGenerateMso = (overrides: Partial<MultiStageOutputOptions<SeedGenerateMsoData>> = {}) => new MultiStageOutput({
2121
preStagesBlock: [
2222
{
2323
get: (data) => data?.jobId,
@@ -65,12 +65,13 @@ export const getSeedGenerateMso = (jsonEnabled: boolean = false) => new MultiSta
6565
label: 'End Time',
6666
}
6767
],
68-
jsonEnabled,
68+
jsonEnabled: false,
6969
stages: [
7070
'Querying source org',
7171
'Data generation',
7272
'Populating target org',
7373
'Pipeline Finished',
7474
],
7575
title: 'Data Seed Generation',
76+
...overrides,
7677
});

0 commit comments

Comments
 (0)