mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
fix: remove unwanted error logging
This commit is contained in:
1 parent
019caf58e4
commit
9e44ebe415
1 file changed
+3
-2
@@ -94,20 +94,21 @@ export async function attachContainer(
|
|||||||
config.docker.network
|
config.docker.network
|
||||||
].IPAddress
|
].IPAddress
|
||||||
|
|
||||||
|
let error: Error | null = null
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
const stream = await connectToSSH(containerIp, { token })
|
const stream = await connectToSSH(containerIp, { token })
|
||||||
return stream
|
return stream
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Failed to connect to SSH', err)
|
error = err as Error
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
setTimeout(resolve, 1000)
|
setTimeout(resolve, 1000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new Error('Failed to connect to SSH')
|
throw new Error('Failed to connect to SSH', { cause: error })
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteContainer(id: string) {
|
export async function deleteContainer(id: string) {
|
||||||
|
|||||||
Reference in new issue
Block a user