Skip to content

Commit f71488b

Browse files
fix: properly update node updatedAt when uptime received
1 parent d5b15d8 commit f71488b

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

indexer/chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ name: tfchainindexer
22
description: Helm Chart for the tfchain hydra indexer
33
version: 2.7.6
44
apiVersion: v2
5-
appVersion: '2.8.0-rc5'
5+
appVersion: '2.8.0-rc6'

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "graphql_tfgrid",
33
"private": "true",
4-
"version": "2.8.0-rc5",
4+
"version": "2.8.0-rc6",
55
"description": "GraphQL server and Substrate indexer. Generated with ♥ by Hydra-CLI",
66
"author": "",
77
"license": "ISC",

processor-chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
name: tfchain-processor
33
description: A chart for the tfchain graphql processor and query node
44
version: 1.0.5
5-
appVersion: '2.8.0-rc5'
5+
appVersion: '2.8.0-rc6'

src/mappings/nodes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,16 @@ export async function nodeUptimeReported(ctx: Ctx): Promise<void> {
383383
let touchedNodes = new Map(
384384
(await ctx.store.find(Node, {
385385
where: {
386-
id: In([...new Set(uptimes.map(up => up.event.nodeID)).keys()])
387-
}
388-
})).map(n => [n.id, n])
386+
nodeID: In([...new Set(uptimes.map(up => up.event.nodeID)).keys()])
387+
}, relations: { location: true, interfaces: true }
388+
})).map(n => [n.nodeID, n])
389389
)
390390

391391
for (let up of uptimes) {
392-
let node = touchedNodes.get(up.event.nodeID.toString())
392+
let node = touchedNodes.get(up.event.nodeID)
393393
if (node) {
394394
node.uptime = up.event.uptime
395-
node.updatedAt = BigInt(up.block.timestamp)
395+
node.updatedAt = BigInt(up.block.timestamp) / BigInt(1000)
396396
}
397397
}
398398

0 commit comments

Comments
 (0)