Skip to content

Commit

Permalink
Merge pull request #723 from shocknet/find-many-take1
Browse files Browse the repository at this point in the history
find many take 1
  • Loading branch information
shocknet-justin authored Aug 29, 2024
2 parents aba3099 + 227c9ff commit e667927
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/storage/metricsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export default class {
}

async GetLatestForwardingIndexOffset() {
const latestIndex = await this.DB.getRepository(ChannelRouting).findOne({ order: { latest_index_offset: "DESC" } })
if (latestIndex) {
return latestIndex.latest_index_offset
const latestIndex = await this.DB.getRepository(ChannelRouting).find({ order: { latest_index_offset: "DESC" }, take: 1 })
if (latestIndex.length > 0) {
return latestIndex[0].latest_index_offset
}
return 0
}
Expand Down

0 comments on commit e667927

Please sign in to comment.