Skip to content

Commit

Permalink
Final Final Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Aug 5, 2024
1 parent 2c4674a commit d04a79f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export default abstract class BaseClass {
.entry(apiData.entryUid)
.publish({
publishDetails: { environments: apiData.environments, locales: apiData.locales },
locale: additionalInfo.locale,
locale: apiData.locales[0],
})
.then(onSuccess)
.catch(onReject);
Expand Down
36 changes: 16 additions & 20 deletions packages/contentstack-import/src/import/modules/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,27 +921,23 @@ export default class EntriesImport extends BaseClass {
});
});
apiContent = apiContentDuplicate;
const promises = apiContentDuplicate.map(async (content: any, index: any) => {
const apiContent = [content];
await this.makeConcurrentCall({
apiContent,
processName,
indexerCount,
currentIndexer: +index,
apiParams: {
reject: onReject,
resolve: onSuccess,
entity: 'publish-entries',
includeParamOnCompletion: true,
serializeData: this.serializePublishEntries.bind(this),
additionalInfo: { contentType, locale: content?.locale, cTUid },
},
concurrencyLimit: this.importConcurrency,
});
await this.makeConcurrentCall({
apiContent,
processName,
indexerCount,
currentIndexer: +index,
apiParams: {
reject: onReject,
resolve: onSuccess,
entity: 'publish-entries',
includeParamOnCompletion: true,
serializeData: this.serializePublishEntries.bind(this),
additionalInfo: { contentType, locale, cTUid },
},
concurrencyLimit: this.importConcurrency,
}).then(() => {
log(this.importConfig, `Published entries for content type ${cTUid} in locale ${locale}`, 'success');
});
// Using Promise.all to handle all promises concurrently
await Promise.allSettled(promises);
log(this.importConfig, `Published entries for content type ${cTUid} in locale ${locale}`, 'success');
}
}
}
Expand Down

0 comments on commit d04a79f

Please sign in to comment.