-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.service.ts
33 lines (28 loc) · 899 Bytes
/
driver.service.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Injectable } from '@nestjs/common'
import { LoggerService } from '../logger/logger.service'
import { DisplayDriverService } from './display-driver.service'
import { GoalDriverService } from './goal-driver.service'
@Injectable()
export class DriverService {
constructor(
private readonly displayDriver: DisplayDriverService,
private readonly goalDriver: GoalDriverService,
private readonly logger: LoggerService,
) {
this.logger.setup(this.constructor.name)
}
async setup() {
this.logger.debug('setup')
await Promise.allSettled([
this.displayDriver.setup(),
this.goalDriver.setup(),
])
}
async teardown() {
this.logger.debug('teardown')
await Promise.allSettled([
this.displayDriver.teardown(),
this.goalDriver.teardown(),
])
}
}