Skip to content

Commit

Permalink
fix: await the logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Jun 3, 2020
1 parent 9cc3451 commit 41cd645
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib/import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ export async function importTarget(
);
}
debug(`Received locationUrl for ${target.name}: ${locationUrl}`);
logImportedTarget(orgId, integrationId, target, locationUrl, loggingPath);
await logImportedTarget(orgId, integrationId, target, locationUrl, loggingPath);
return {
pollingUrl: locationUrl,
integrationId,
target,
orgId,
};
} catch (error) {
logFailedImports(orgId, integrationId, target, loggingPath);
await logFailedImports(orgId, integrationId, target, loggingPath);
const err: {
message?: string | undefined;
innerError?: string;
Expand Down Expand Up @@ -107,7 +107,7 @@ export async function importTargets(
pollingUrls.push(pollingUrl);
} catch (error) {
const { orgId, integrationId, target } = t;
logFailedImports(orgId, integrationId, target, loggingPath);
await logFailedImports(orgId, integrationId, target, loggingPath);
debug('Failed to process:', JSON.stringify(t), error.message);
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/poll-import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function pollImportUrls(
allProjects,
(p: Project) => !p.success,
);
logFailedProjects(locationUrl, failedProjects);
await logFailedProjects(locationUrl, failedProjects);
projectsArray.push(...projects);
} catch (error) {
logFailedPollUrls(locationUrl, error.message || error);
Expand Down

0 comments on commit 41cd645

Please sign in to comment.