@@ -5,6 +5,7 @@ import { EventEmitter2 } from '@nestjs/event-emitter';
55import { CommandBus , QueryBus } from '@nestjs/cqrs' ;
66import { Logger } from '@nestjs/common' ;
77
8+ import { formatExecutionTime , getTime } from '@common/utils/get-elapsed-time' ;
89import { AxiosService } from '@common/axios/axios.service' ;
910import { EVENTS } from '@libs/contracts/constants' ;
1011
@@ -109,21 +110,21 @@ export class StartNodeProcessor extends WorkerHost {
109110 return ;
110111 }
111112
112- const startTime = Date . now ( ) ;
113+ const startTime = getTime ( ) ;
113114 const config = await this . queryBus . execute (
114115 new GetPreparedConfigWithUsersQuery (
115116 nodeEntity . activeConfigProfileUuid ,
116117 nodeEntity . activeInbounds ,
117118 ) ,
118119 ) ;
119120
120- this . logger . log ( `Generated config for node in ${ Date . now ( ) - startTime } ms ` ) ;
121+ this . logger . log ( `Generated config for node in ${ formatExecutionTime ( startTime ) } ` ) ;
121122
122123 if ( ! config . isOk || ! config . response ) {
123124 throw new Error ( 'Failed to get config for node' ) ;
124125 }
125126
126- const reqStartTime = Date . now ( ) ;
127+ const reqStartTime = getTime ( ) ;
127128
128129 const res = await this . axios . startXray (
129130 config . response . config as unknown as Record < string , unknown > ,
@@ -132,7 +133,7 @@ export class StartNodeProcessor extends WorkerHost {
132133 nodeEntity . port ,
133134 ) ;
134135
135- this . logger . log ( `Started node in ${ Date . now ( ) - reqStartTime } ms ` ) ;
136+ this . logger . log ( `Started node in ${ formatExecutionTime ( reqStartTime ) } ` ) ;
136137
137138 if ( ! res . isOk || ! res . response ) {
138139 await this . commandBus . execute (
0 commit comments