track when neighbours were last updated

This commit is contained in:
liamcottle committed 2024-03-23 23:34:02 +13:00
1 parent 3abdabdd09
commit b9082ebedb
3 files changed
+4

No files matched your search

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `nodes` ADD COLUMN `neighbours_updated_at` DATETIME(3) NULL;
+1
View File
@@ -33,6 +33,7 @@ model Node {
neighbour_broadcast_interval_secs Int?
neighbours Json?
neighbours_updated_at DateTime?
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
+1
View File
@@ -298,6 +298,7 @@ client.on("message", async (topic, message) => {
node_id: envelope.packet.from,
},
data: {
neighbours_updated_at: new Date(),
neighbour_broadcast_interval_secs: neighbourInfo.nodeBroadcastIntervalSecs,
neighbours: neighbourInfo.neighbors.map((neighbour) => {
return {