• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 7959999835

19 Feb 2024 01:04PM UTC coverage: 93.953% (+0.02%) from 93.936%
7959999835

Pull #1154

github

iamacook
Remove checksum from cache router
Pull Request #1154: Throw custom errors from relayer

1643 of 1954 branches covered (84.08%)

Branch coverage included in aggregate %.

46 of 46 new or added lines in 10 files covered. (100.0%)

3 existing lines in 2 files now uncovered.

6141 of 6331 relevant lines covered (97.0%)

193.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/datasources/db/postgres-database.shutdown.hook.ts
1
import { Inject, Injectable, OnModuleDestroy } from '@nestjs/common';
80✔
2
import postgres from 'postgres';
80✔
3
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
80✔
4

5
@Injectable()
6
export class PostgresDatabaseShutdownHook implements OnModuleDestroy {
80✔
7
  private static readonly CONNECTION_CLOSE_TIMEOUT_IN_SECONDS = 5;
80✔
8

9
  constructor(
10
    @Inject('DB_INSTANCE') private readonly db: postgres.Sql,
×
11
    @Inject(LoggingService) private readonly loggingService: ILoggingService,
×
12
  ) {}
13

14
  async onModuleDestroy(): Promise<void> {
15
    this.loggingService.info('Closing database connection');
×
16
    // Resolves when all queries are finished and the underlying connections are closed
17
    await this.db.end({
×
18
      // Any pending queries will be rejected once the timeout is reached
19
      timeout: PostgresDatabaseShutdownHook.CONNECTION_CLOSE_TIMEOUT_IN_SECONDS,
20
    });
21
    this.loggingService.info('Database connection closed');
×
22
  }
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc