mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-18 18:55:50 +00:00
Resubscribe on reconnect
This commit is contained in:
@@ -13,6 +13,8 @@ await createDirectory('store/xpop')
|
||||
|
||||
process.env.NODES.split(',').map(h => h.trim())
|
||||
.map(h => new XrplClient(h)).map(async c => {
|
||||
|
||||
const subscribe = async () => {
|
||||
await c.ready()
|
||||
|
||||
/**
|
||||
@@ -40,4 +42,7 @@ process.env.NODES.split(',').map(h => h.trim())
|
||||
ledger,
|
||||
connection: c,
|
||||
}))
|
||||
}
|
||||
|
||||
c.on('online', () => subscribe())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user