Skip to content

Commit

Permalink
chore: try to prevent OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Apr 19, 2023
1 parent a75e4e3 commit eed8eb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/batch/tasks/init-job-state.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const initJobStateTask: ListrTask = {
process.chdir('../../');
}

// try to prevent OOM
await new Promise((resolve) => setTimeout(resolve, 500));

task.title = `${task.title} successful`;
},
};
2 changes: 1 addition & 1 deletion lib/tasks/save-project-api.task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const saveProjectApiTask: ListrTask = {
},
task: async (ctx, task) => {
// try to prevent OOM in case of large result
await new Promise<void>((resolve) => setTimeout(() => resolve(), 200));
await new Promise<void>((resolve) => setTimeout(() => resolve(), 500 ));
return api.uploadProject(ctx.results).then(() => {
task.title = `${task.title} successful, ${getHumanReadableFileSize(
Buffer.byteLength(JSON.stringify(ctx.results), 'utf8')
Expand Down

0 comments on commit eed8eb4

Please sign in to comment.