File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 3
3
Injectable ,
4
4
type OnApplicationBootstrap ,
5
5
} from '@nestjs/common' ;
6
+ import { ModuleRef } from '@nestjs/core' ;
7
+ import { LazyGetter as Once } from 'lazy-get-decorator' ;
6
8
import { CryptoService } from '~/core/authentication/crypto.service' ;
7
9
import { ConfigService } from '~/core/config/config.service' ;
8
10
import { ILogger , Logger } from '~/core/logger' ;
@@ -13,11 +15,15 @@ import { AdminRepository } from './admin.repository';
13
15
export class AdminGelService implements OnApplicationBootstrap {
14
16
constructor (
15
17
private readonly config : ConfigService ,
16
- private readonly crypto : CryptoService ,
17
18
@Inject ( AdminRepository ) private readonly repo : AdminGelRepository ,
19
+ private readonly moduleRef : ModuleRef ,
18
20
@Logger ( 'admin:service' ) private readonly logger : ILogger ,
19
21
) { }
20
22
23
+ @Once ( ) private get crypto ( ) {
24
+ return this . moduleRef . get ( CryptoService , { strict : false } ) ;
25
+ }
26
+
21
27
async onApplicationBootstrap ( ) : Promise < void > {
22
28
const finishing = this . repo . finishing ( ( ) => this . setupRootUser ( ) ) ;
23
29
// Wait for root object setup when running tests, else just let it run in
You can’t perform that action at this time.
0 commit comments