Skip to content

Commit

Permalink
fix(api): avoid data request status check in routed price feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommytrg committed May 15, 2024
1 parent b3dba8b commit e72b31c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/web3Middleware/NetworkRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class NetworkRouter {
const snapshot = await this.getSnapshot()
const insertPromises = snapshot.feeds
.filter((feed) => {
return feed.status === ResultStatus.Ready
return feed.status === ResultStatus.Ready || PriceFeed.isRouted(feed.solver)
})
.map((feed) => ({
feedFullName: createFeedFullName(
Expand Down
8 changes: 6 additions & 2 deletions packages/api/src/web3Middleware/PriceFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ export class PriceFeed {
if (!feedConfiguration || Object.keys(feedConfiguration).length === 0) {
throw new Error(`${feed.caption} not found in configuration file`)
}

const isRouted: boolean = feed.solver.endsWith('000000000000000000000000')
const isRouted: boolean = this.isRouted(feed.solver)

if (isRouted) {
feedConfiguration.maxSecsBetweenUpdates = 0
Expand Down Expand Up @@ -123,4 +122,9 @@ export class PriceFeed {
chain,
})
}

static isRouted(solver: string): boolean {
// ends in 24 0s
return solver.endsWith('000000000000000000000000')
}
}

0 comments on commit e72b31c

Please sign in to comment.