fix(lint): enable no-floating-promises rule and handle all promises
Enable @typescript-eslint/no-floating-promises to catch unhandled promise rejections. Fixes: - HealthGateway.sendInitialData: void for fire-and-forget - DomainHealthService.checkDomainHealth: void for startup check - main.ts bootstrap: .catch() with proper error handling - MetricsPersistenceService.flushBatch: void for async batching 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3dba081b0a
commit
ec0d12a5f9
4 changed files with 10 additions and 7 deletions
|
|
@ -81,8 +81,8 @@ export class HealthGateway
|
|||
`Client connected: ${client.id} (${isAuthenticated ? 'authenticated' : 'public'}, Total: ${this.clients.size})`,
|
||||
);
|
||||
|
||||
// Send initial data to newly connected client
|
||||
this.sendInitialData(client);
|
||||
// Send initial data to newly connected client (fire-and-forget)
|
||||
void this.sendInitialData(client);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ export class DomainHealthService {
|
|||
});
|
||||
}
|
||||
|
||||
// Check immediately on startup
|
||||
this.checkDomainHealth();
|
||||
// Check immediately on startup (fire-and-forget)
|
||||
void this.checkDomainHealth();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -171,4 +171,7 @@ async function bootstrap() {
|
|||
`);
|
||||
}
|
||||
|
||||
bootstrap();
|
||||
bootstrap().catch((err) => {
|
||||
console.error('Failed to start application:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,12 +68,12 @@ export class MetricsPersistenceService {
|
|||
|
||||
// Flush if batch size reached
|
||||
if (this.batchQueue.length >= this.BATCH_SIZE) {
|
||||
this.flushBatch();
|
||||
void this.flushBatch();
|
||||
} else {
|
||||
// Schedule batch flush if not already scheduled
|
||||
if (!this.batchTimer) {
|
||||
this.batchTimer = setTimeout(() => {
|
||||
this.flushBatch();
|
||||
void this.flushBatch();
|
||||
}, this.BATCH_TIMEOUT_MS);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue