more lint fixes
This commit is contained in:
parent
3e545cdaa9
commit
67c073e4f2
7 changed files with 29 additions and 15 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue