Skip to content

Commit 915f692

Browse files
committed
Final Final Fixed
1 parent 7472caa commit 915f692

2 files changed

Lines changed: 17 additions & 21 deletions

File tree

packages/contentstack-import/src/import/modules/base-class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export default abstract class BaseClass {
374374
.entry(apiData.entryUid)
375375
.publish({
376376
publishDetails: { environments: apiData.environments, locales: apiData.locales },
377-
locale: additionalInfo.locale,
377+
locale: apiData.locales[0],
378378
})
379379
.then(onSuccess)
380380
.catch(onReject);

packages/contentstack-import/src/import/modules/entries.ts

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -921,27 +921,23 @@ export default class EntriesImport extends BaseClass {
921921
});
922922
});
923923
apiContent = apiContentDuplicate;
924-
const promises = apiContentDuplicate.map(async (content: any, index: any) => {
925-
const apiContent = [content];
926-
await this.makeConcurrentCall({
927-
apiContent,
928-
processName,
929-
indexerCount,
930-
currentIndexer: +index,
931-
apiParams: {
932-
reject: onReject,
933-
resolve: onSuccess,
934-
entity: 'publish-entries',
935-
includeParamOnCompletion: true,
936-
serializeData: this.serializePublishEntries.bind(this),
937-
additionalInfo: { contentType, locale: content?.locale, cTUid },
938-
},
939-
concurrencyLimit: this.importConcurrency,
940-
});
924+
await this.makeConcurrentCall({
925+
apiContent,
926+
processName,
927+
indexerCount,
928+
currentIndexer: +index,
929+
apiParams: {
930+
reject: onReject,
931+
resolve: onSuccess,
932+
entity: 'publish-entries',
933+
includeParamOnCompletion: true,
934+
serializeData: this.serializePublishEntries.bind(this),
935+
additionalInfo: { contentType, locale, cTUid },
936+
},
937+
concurrencyLimit: this.importConcurrency,
938+
}).then(() => {
939+
log(this.importConfig, `Published entries for content type ${cTUid} in locale ${locale}`, 'success');
941940
});
942-
// Using Promise.all to handle all promises concurrently
943-
await Promise.allSettled(promises);
944-
log(this.importConfig, `Published entries for content type ${cTUid} in locale ${locale}`, 'success');
945941
}
946942
}
947943
}

0 commit comments

Comments
 (0)