This commit is contained in:
Philipp Kunz 2022-02-27 22:21:35 +00:00
parent efa5982dc9
commit 26f0ac0508

View File

@ -62,8 +62,13 @@ export class Bobcat {
*/ */
public async runMaintenance () { public async runMaintenance () {
await plugins.smartpromise.timeoutAndContinue(this.checkMinerStatus()); await plugins.smartpromise.timeoutAndContinue(this.checkMinerStatus());
await plugins.smartdelay.delayFor(10000);
await plugins.smartpromise.timeoutAndContinue(this.gatherMinerDetails()); await plugins.smartpromise.timeoutAndContinue(this.gatherMinerDetails());
if (this.latestStatus.status === 'Synced' && parseInt(this.latestStatus.gap) > -50 && parseInt(this.latestStatus.gap) < 50) { await plugins.smartdelay.delayFor(10000);
await plugins.smartpromise.timeoutAndContinue(this.checkMinerStatus());
await plugins.smartdelay.delayFor(10000);
await plugins.smartpromise.timeoutAndContinue(this.gatherMinerDetails());
if (this.latestStatus.status === 'Synced' && parseInt(this.latestStatus.gap) > -100 && parseInt(this.latestStatus.gap) < 50) {
console.log(`Miner ${this.latestMinerDetails.animal} at ${this.networkAddress} is Synced. ok!`) console.log(`Miner ${this.latestMinerDetails.animal} at ${this.networkAddress} is Synced. ok!`)
return; return;
} }
@ -78,11 +83,24 @@ export class Bobcat {
if (this.latestStatus.status !== 'Synced') { if (this.latestStatus.status !== 'Synced') {
console.log(`Miner ${this.latestMinerDetails.animal} is not synced. Restarting now!`); console.log(`Miner ${this.latestMinerDetails.animal} is not synced. Restarting now!`);
try { try {
await this.restart() await this.restart();
return;
} catch (err) { } catch (err) {
} }
} }
if (this.latestStatus.status === 'Synced' && parseInt(this.latestStatus.gap) < -100) {
console.log(`Miner ${this.latestMinerDetails.animal} is Synced, but strangely ahead of blockchain. Restarting!`);
try {
await this.restart();
return;
} catch (err) {
}
}
console.log(`Looks like miner ${this.latestMinerDetails.animal} is Synced, but does not fall under predefined statuses!`);
} }
/** /**