mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
Reduce production hot-path logging
This commit is contained in:
@@ -506,6 +506,10 @@ export class StratumV1Service implements OnModuleInit, OnModuleDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.shouldLogJobFanout(jobTemplate.blockData.isNewBlock, errors)) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(JSON.stringify({
|
||||
event: 'stratum_job_fanout',
|
||||
eventId: jobTemplate.blockData.notificationEventId,
|
||||
@@ -530,6 +534,13 @@ export class StratumV1Service implements OnModuleInit, OnModuleDestroy {
|
||||
}));
|
||||
}
|
||||
|
||||
private shouldLogJobFanout(isNewBlock: boolean, errors: number): boolean {
|
||||
if (errors > 0 || isNewBlock) {
|
||||
return true;
|
||||
}
|
||||
return process.env.STRATUM_FANOUT_LOG_ENABLED?.toLowerCase() === 'true';
|
||||
}
|
||||
|
||||
private isBackpressureDisabled() {
|
||||
return process.env.STRATUM_BACKPRESSURE_ENABLED?.toLowerCase() === 'false';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user