-
Notifications
You must be signed in to change notification settings - Fork 10
CMG-1093 | Contentful migration got stuck some time #1122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -335,11 +335,7 @@ async function readFile(filePath: string, fileName: string) { | |
| * @throws {Error} - If there is an error writing the file. | ||
| */ | ||
| async function writeOneFile(indexPath: string, fileMeta: any) { | ||
| fs.writeFile(indexPath, JSON.stringify(fileMeta), (err) => { | ||
| if (err) { | ||
| console.error("Error writing file: 3", err); | ||
| } | ||
| }); | ||
| await fs.promises.writeFile(indexPath, JSON.stringify(fileMeta)); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -798,6 +794,7 @@ const createAssets = async (packagePath: any, destination_stack_id: string, proj | |
| ); | ||
|
|
||
| await Promise.all(tasks); | ||
| await fs.promises.mkdir(assetsSave, { recursive: true }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: (verified good) Correct and necessary. When every asset fails, |
||
| const assetMasterFolderPath = path.join(assetsSave, ASSETS_FAILED_FILE); | ||
|
|
||
| await writeOneFile(path.join(assetsSave, ASSETS_SCHEMA_FILE), assetData); | ||
|
chetan-contentstack marked this conversation as resolved.
|
||
|
|
@@ -833,6 +830,7 @@ const createAssets = async (packagePath: any, destination_stack_id: string, proj | |
| err | ||
| ) | ||
| await customLogger(projectId, destination_stack_id, 'error', message); | ||
| throw err; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blocker: Re-throwing here is the right intent (abort the sequential step chain so
So any FS failure the outer Suggested fix: don't let it propagate to the detached promise. Either handle it where the migration actually runs, e.g. in |
||
| } | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.