mirror of
https://github.com/remnawave/node.git
synced 2026-10-21 18:31:34 +00:00
refactor: improve logging for Xray internal status checks with elapsed time tracking
This commit is contained in:
parent
881c4261ea
commit
9b40f82101
1 changed files with 9 additions and 2 deletions
|
|
@ -390,6 +390,7 @@ export class XrayService implements OnApplicationBootstrap {
|
|||
}
|
||||
|
||||
private async getXrayInternalStatus(): Promise<boolean> {
|
||||
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,
|
||||
},
|
||||
)}`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue