Browse Source

log

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
b38e17f4ed
  1. 4
      dist/src/grpc/index.js
  2. 2
      dist/src/grpc/index.js.map
  3. 4
      src/grpc/index.ts

4
dist/src/grpc/index.js

@ -138,13 +138,15 @@ function reconnectToLND(innerCtx) {
return __awaiter(this, void 0, void 0, function* () {
ctx = innerCtx;
i++;
console.log(`=> [lnd] reconnecting... attempt #${i}`);
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim();
console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`);
try {
yield network.initGrpcSubscriptions();
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim();
console.log(`=> [lnd] reconnected! ${now}`);
}
catch (e) {
console.log("COULD NOT RECONNECT", e, e.message, e.code);
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
if (ctx === innerCtx) { // if another retry fires, then this will not run
yield reconnectToLND(innerCtx);

2
dist/src/grpc/index.js.map

File diff suppressed because one or more lines are too long

4
src/grpc/index.ts

@ -132,12 +132,14 @@ var ctx = 0
async function reconnectToLND(innerCtx:number){
ctx = innerCtx
i++
console.log(`=> [lnd] reconnecting... attempt #${i}`)
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim();
console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`)
try {
await network.initGrpcSubscriptions()
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim();
console.log(`=> [lnd] reconnected! ${now}`)
} catch(e) {
console.log("COULD NOT RECONNECT",e,e.message,e.code)
setTimeout(async()=>{ // retry each 2 secs
if(ctx===innerCtx) { // if another retry fires, then this will not run
await reconnectToLND(innerCtx)

Loading…
Cancel
Save