Skip to content

Commit

Permalink
fix: await set cached routes (#754)
Browse files Browse the repository at this point in the history
* fix: await set cached routes

* 4.7.6
  • Loading branch information
jsy1218 authored Oct 29, 2024
1 parent 4067969 commit 25b034d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniswap/smart-order-router",
"version": "4.7.5",
"version": "4.7.6",
"description": "Uniswap Smart Order Router",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
Expand Down
8 changes: 3 additions & 5 deletions src/routers/alpha-router/alpha-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ export class AlphaRouter
amount.toExact()
);

this.setCachedRoutesAndLog(
await this.setCachedRoutesAndLog(
amount,
currencyIn,
currencyOut,
Expand Down Expand Up @@ -1772,7 +1772,7 @@ export class AlphaRouter
amount.toExact()
);

this.setCachedRoutesAndLog(
await this.setCachedRoutesAndLog(
amount,
currencyIn,
currencyOut,
Expand Down Expand Up @@ -1911,9 +1911,7 @@ export class AlphaRouter
routesToCache?: CachedRoutes
): Promise<void> {
if (routesToCache) {
// Attempt to insert the entry in cache. This is fire and forget promise.
// The catch method will prevent any exception from blocking the normal code execution.
this.routeCachingProvider
await this.routeCachingProvider
?.setCachedRoute(routesToCache, amount)
.then((success) => {
const status = success ? 'success' : 'rejected';
Expand Down

0 comments on commit 25b034d

Please sign in to comment.