fix(core): update

This commit is contained in:
Philipp Kunz 2022-02-25 21:45:21 +01:00
parent 8c01d5cabf
commit b8eb82de12
2 changed files with 15 additions and 0 deletions

View File

@ -50,6 +50,17 @@ export class Bobcat {
await this.gatherMinerDetails(); await this.gatherMinerDetails();
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!`);
await this.restart().catch();
} }
} }
public async restart() {
const response = await plugins.smartrequest.request(`http://${this.networkAddress}/admin/reboot`, {
method: 'POST',
headers: {
Authorization: 'Basic ' + Buffer.from('bobcat:miner').toString('base64')
}
});
console.log(response.statusCode);
}
} }

View File

@ -21,4 +21,8 @@ export class BobcatManager {
await bobcat.runMaintenance(); await bobcat.runMaintenance();
} }
}; };
public async restart() {
}
} }