Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Jan 19, 2024
1 parent bd2f2d1 commit fdd1cee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions worker/src/queues/submission/workers/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ axios.interceptors.request.use((intercepted) => {

axios.interceptors.response.use((intercepted) => {
// @ts-ignore
intercepted.meta.requestFinishedAt = new Date().getTime();
intercepted.config.meta.requestFinishedAt = new Date().getTime();
// @ts-ignore
intercepted.meta.responseTime = intercepted.meta.requestFinishedAt - intercepted.config.meta.requestStartedAt;
intercepted.config.meta.responseTime = intercepted.config.meta.requestFinishedAt - intercepted.config.meta.requestStartedAt;
return intercepted;
});

Expand All @@ -44,8 +44,8 @@ export async function submitHandler(job: Job<SubmitJob>) {
timeout: REQUEST_TIMEOUT,
});
// @ts-ignore
logger.info(jobLogData, `${url} took ${res.meta.responseTime}ms`);
logger.info(jobLogData, `${url} responded with ${res.status} - ${res.data}`);
logger.info(jobLogData, `${url} took ${res.config.meta.responseTime}ms`);
logger.info(jobLogData, `${url} responded with ${res.status} - ${JSON.stringify(res.data)}`);

const reference = res.data.reference;
if (reference) {
Expand Down

0 comments on commit fdd1cee

Please sign in to comment.