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

safe-global / safe-client-gateway / 8080543737

28 Feb 2024 12:42PM UTC coverage: 93.642% (-0.06%) from 93.699%
8080543737

Pull #1215

github

hectorgomezv
Add min to random values of CacheHooksController tests
Pull Request #1215: Align FakeCacheService and RedisCacheService implementations

1676 of 2005 branches covered (83.59%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

6145 of 6347 relevant lines covered (96.82%)

347.64 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';
82✔
2
import postgres from 'postgres';
82✔
3
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
82✔
4

5
@Injectable()
6
export class PostgresDatabaseShutdownHook implements OnModuleDestroy {
82✔
7
  private static readonly CONNECTION_CLOSE_TIMEOUT_IN_SECONDS = 5;
82✔
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