Skip to content

Commit

Permalink
fix: cache client authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Harasz committed Jun 28, 2022
1 parent 6224b1a commit 619845d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/modules/cache-client/cache-client.service.ts
Expand Up @@ -113,7 +113,7 @@ export class CacheClient implements ICacheClient {
}

// Run previously failed requests
console.log(
getLogger().info(
`[CACHE CLIENT] Running failed requests: ${this.failedRequests.length}`
);
this.failedRequests = this.failedRequests.filter((callback) => callback());
Expand Down Expand Up @@ -156,9 +156,14 @@ export class CacheClient implements ICacheClient {
});
});
if (!this.isAuthenticating) {
this.isAuthenticating = true;
await this.authenticate();
this.isAuthenticating = false;
try {
this.isAuthenticating = true;
await this.authenticate();
} catch {
return Promise.reject(error);
} finally {
this.isAuthenticating = false;
}
}
return retryOriginalRequest;
}
Expand Down

0 comments on commit 619845d

Please sign in to comment.