mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-27 02:02:10 +01:00
remove watchdog
This commit is contained in:
parent
e5efe2df21
commit
a9e8b66a6f
@ -318,25 +318,25 @@ export class StratumV1Client {
|
||||
|
||||
this.backgroundWork = setInterval(async () => {
|
||||
await this.checkDifficulty();
|
||||
await this.watchdog();
|
||||
//await this.watchdog();
|
||||
}, 60 * 1000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private async watchdog() {
|
||||
let time = await this.statistics.getLastSubmissionTime();
|
||||
if (time == null) {
|
||||
time = this.sessionStart;
|
||||
}
|
||||
const now = Date.now();
|
||||
const diffSeconds = (now - time.getTime()) / 1000;
|
||||
// fifteen minutes
|
||||
if (diffSeconds > 15 * 60) {
|
||||
console.log('Watchdog ending session');
|
||||
this.promiseSocket.socket.emit('end', true);
|
||||
}
|
||||
}
|
||||
// private async watchdog() {
|
||||
// let time = await this.statistics.getLastSubmissionTime();
|
||||
// if (time == null) {
|
||||
// time = this.sessionStart;
|
||||
// }
|
||||
// const now = Date.now();
|
||||
// const diffSeconds = (now - time.getTime()) / 1000;
|
||||
// // one hour
|
||||
// if (diffSeconds > 60 * 60) {
|
||||
// console.log(`Watchdog ending session ${this.extraNonceAndSessionId}}`);
|
||||
// this.promiseSocket.socket.emit('end', true);
|
||||
// }
|
||||
// }
|
||||
|
||||
private async sendNewMiningJob(jobTemplate: IJobTemplate) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user