more lint fixes

This commit is contained in:
Boki 2025-06-20 09:10:57 -04:00
parent 3e545cdaa9
commit 67c073e4f2
7 changed files with 29 additions and 15 deletions

View file

@ -49,7 +49,7 @@ export class PostgreSQLClient {
let lastError: Error | null = null;
for (let attempt = 1; attempt <= this.options.retryAttempts!; attempt++) {
for (let attempt = 1; attempt <= (this.options.retryAttempts ?? 3); attempt++) {
try {
this.logger.info(
`Connecting to PostgreSQL (attempt ${attempt}/${this.options.retryAttempts})...`
@ -81,8 +81,8 @@ export class PostgreSQLClient {
this.pool = null;
}
if (attempt < this.options.retryAttempts!) {
await this.delay(this.options.retryDelay! * attempt);
if (attempt < (this.options.retryAttempts ?? 3)) {
await this.delay((this.options.retryDelay ?? 1000) * attempt);
}
}
}

View file

@ -68,7 +68,10 @@ export class PostgreSQLHealthMonitor {
if (!this.lastHealthCheck) {
await this.performHealthCheck();
}
return this.lastHealthCheck!;
if (!this.lastHealthCheck) {
throw new Error('Health check failed to produce results');
}
return this.lastHealthCheck;
}
/**