Skip to content

Commit 2c09de6

Browse files
committed
chore: rename loop attempts variable
1 parent d6fb26c commit 2c09de6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/remote.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ export class Remote {
832832
const logger = getMemoryLogger()
833833
logger.info(`Starting SSH process ID search with timeout: ${timeout}ms`)
834834

835-
let attempts = 0
835+
let loopAttempts = 0
836836
let lastFilePath: string | undefined
837837

838838
const search = async (logPath: string): Promise<number | undefined> => {
@@ -842,7 +842,7 @@ export class Remote {
842842
// process will be logging network information periodically to a file.
843843
const text = await fs.readFile(logPath, "utf8")
844844

845-
if (attempts % 5 === 0) {
845+
if (loopAttempts % 5 === 0) {
846846
logger.debug(`SSH log file size: ${text.length} bytes`)
847847
}
848848

@@ -878,17 +878,17 @@ export class Remote {
878878
const start = Date.now()
879879

880880
const loop = async (): Promise<number | undefined> => {
881-
attempts++
881+
loopAttempts++
882882

883883
const elapsed = Date.now() - start
884884
if (elapsed > timeout) {
885-
logger.info(`SSH process ID search timed out after ${attempts} attempts, elapsed: ${elapsed}ms`)
885+
logger.info(`SSH process ID search timed out after ${loopAttempts} attempts, elapsed: ${elapsed}ms`)
886886
return undefined
887887
}
888888

889889
// Log progress periodically
890-
if (attempts % 5 === 0) {
891-
logger.info(`SSH process ID search attempt #${attempts}, elapsed: ${elapsed}ms`)
890+
if (loopAttempts % 5 === 0) {
891+
logger.info(`SSH process ID search attempt #${loopAttempts}, elapsed: ${elapsed}ms`)
892892
logger.logMemoryUsage("SSH_PROCESS_SEARCH")
893893
}
894894

@@ -919,7 +919,7 @@ export class Remote {
919919
})
920920
}
921921

922-
logger.info(`SSH process ID search completed successfully after ${attempts} attempts, elapsed: ${elapsed}ms`)
922+
logger.info(`SSH process ID search completed successfully after ${loopAttempts} attempts, elapsed: ${elapsed}ms`)
923923
return result
924924
}
925925

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy