Skip to content
Snippets Groups Projects
Commit c28d1120 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Ignore errors when monitor.js can not connect. Also, use Date.now() correctly.

parent a499e066
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
trap 'exit 1' ERR
# Go $HOME
cd
# Log in home directory
exec < /dev/null > bfa-cron-output.log 2>&1
exec < /dev/null > ${HOME}/bfa-cron-output.log 2>&1
# Go to script bin, 'cause we expect to find $BFAHOME/bin/env there
cd `dirname $0`
source ./env
......
......@@ -101,7 +101,7 @@ function peerlist()
},
function failedToGetAdminPeers(x)
{
console.log( x );
// ignore connection problems?
}
);
}
......@@ -156,17 +156,15 @@ function mayseal()
function failedToGetIsMiningBool(x)
{
// Probably geth is not running.
console.log(x);
//console.log(x);
}
);
}
function unlock()
{
var now = new Date();
if ( lastUnlock + 600 > now )
if ( lastUnlock + 600 > Date.now() / 1000 )
return;
lastUnlock = now;
web3.eth.personal.bfalistWallets()
.then(
function pushone(x)
......@@ -192,6 +190,7 @@ function unlock()
promises.push( promise );
}
}
lastUnlock = Date.now() / 1000;
}
,
function err(x)
......@@ -208,5 +207,5 @@ function timer()
unlock();
}
peerlist();
setInterval( timer, 60 * 1000 );
setTimeout( timer, 5 * 1000 );
setInterval( timer, 60 * 1000 );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment