Automatically refresh lndhub token once a day

This commit is contained in:
Râu Cao
2023-11-22 21:12:24 +01:00
parent 35844b577c
commit 833ab50616
2 changed files with 5 additions and 0 deletions

View File

@@ -120,6 +120,8 @@ function connectLndhub () {
return lndhub.auth(config.lndhub.username, config.lndhub.password).then(connected => {
if (connected) {
console.log("Connected to Lndhub");
// automatically refresh auth token once a day
setInterval(lndhub.reauth, 86400000);
} else {
process.exit(1);
}