Skip to content

Commit

Permalink
Fix issue when arr takes long to import a file
Browse files Browse the repository at this point in the history
In case when the previous file has already been deleted and new one not yet imported, the response will not contain the data about the given file. In this case the hasFile field is false, checking that should resolve the issue.
  • Loading branch information
andrasmaroy committed Mar 20, 2024
1 parent a982ceb commit 6bb4587
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function
case 3:
res = _a.sent();
fileKey = fileField;
if (!(res.data[fileKey].path === outputPath)) return [3 /*break*/, 5];
if (!(!res.data.hasFile || res.data[fileKey].path === outputPath)) return [3 /*break*/, 5];
args.jobLog('File not imported yet, waiting...');
return [4 /*yield*/, new Promise(function (f) { return setTimeout(f, retry_delay * 1000); })];
case 4:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
{ headers },
);
const fileKey = fileField as keyof typeof res.data;
if (res.data[fileKey].path === outputPath) {
if (!res.data.hasFile || res.data[fileKey].path === outputPath) {
args.jobLog('File not imported yet, waiting...');
await new Promise((f) => setTimeout(f, retry_delay * 1000));
} else {
Expand Down

0 comments on commit 6bb4587

Please sign in to comment.