From 9b40f82101ac43930cccd4281aaea0e618fedd26 Mon Sep 17 00:00:00 2001 From: kastov Date: Sun, 10 May 2026 21:53:41 +0300 Subject: [PATCH] refactor: improve logging for Xray internal status checks with elapsed time tracking --- src/modules/xray-core/xray.service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/xray-core/xray.service.ts b/src/modules/xray-core/xray.service.ts index 8ca71af..7f6e9e4 100644 --- a/src/modules/xray-core/xray.service.ts +++ b/src/modules/xray-core/xray.service.ts @@ -390,6 +390,7 @@ export class XrayService implements OnApplicationBootstrap { } private async getXrayInternalStatus(): Promise { + const tm = performance.now(); try { return await pRetry( async () => { @@ -405,8 +406,14 @@ export class XrayService implements OnApplicationBootstrap { maxTimeout: 2000, factor: 1.5, onFailedAttempt: (error) => { - this.logger.debug( - `Get Xray internal status attempt ${error.attemptNumber} failed. ${error.retriesLeft} retries left.`, + this.logger.warn( + `↻ XRay Core status check, ${error.attemptNumber}/${error.attemptNumber + error.retriesLeft} · elapsed ${ems( + performance.now() - tm, + { + extends: 'short', + includeMs: true, + }, + )}`, ); }, },