fix(core): update
This commit is contained in:
parent
74ea18dc76
commit
f227eaee37
@ -8,8 +8,8 @@ export class Bobcat {
|
|||||||
// STATIC
|
// STATIC
|
||||||
public static async createFromNetworkAddress(networkAddressArg: string) {
|
public static async createFromNetworkAddress(networkAddressArg: string) {
|
||||||
const newBobcat = new Bobcat(networkAddressArg);
|
const newBobcat = new Bobcat(networkAddressArg);
|
||||||
await newBobcat.gatherMinerDetails();
|
await newBobcat.checkMinerStatus().catch();
|
||||||
await newBobcat.checkMinerStatus();
|
await newBobcat.gatherMinerDetails().catch();
|
||||||
return newBobcat;
|
return newBobcat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,4 +41,15 @@ export class Bobcat {
|
|||||||
this.latestMinerDetails = body;
|
this.latestMinerDetails = body;
|
||||||
return this.latestMinerDetails;
|
return this.latestMinerDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* runs maintenance on the bobcat
|
||||||
|
*/
|
||||||
|
public async runMaintenance() {
|
||||||
|
await this.checkMinerStatus();
|
||||||
|
await this.gatherMinerDetails();
|
||||||
|
if (this.latestStatus.status !== 'Synced') {
|
||||||
|
console.log(`Miner ${this.latestMinerDetails.animal} is not synced. Restarting now!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,4 +11,14 @@ export class BobcatManager {
|
|||||||
const newBobcat = await Bobcat.createFromNetworkAddress(networkAddressArg);
|
const newBobcat = await Bobcat.createFromNetworkAddress(networkAddressArg);
|
||||||
this.bobcats.push(newBobcat);
|
this.bobcats.push(newBobcat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* runs the maintenance on all managed bobcats
|
||||||
|
*/
|
||||||
|
public async runMaintenance() {
|
||||||
|
console.log(`now running maintenance on ${this.bobcats.length} bobcats!`);
|
||||||
|
for (const bobcat of this.bobcats) {
|
||||||
|
await bobcat.runMaintenance();
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user