mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20: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
|
||||
].IPAddress
|
||||
|
||||
let error: Error | null = null
|
||||
for (let i = 0; i < 10; i++) {
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const stream = await connectToSSH(containerIp, { token })
|
||||
return stream
|
||||
} catch (err) {
|
||||
logger.error('Failed to connect to SSH', err)
|
||||
error = err as Error
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await new Promise((resolve) => {
|
||||
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) {
|
||||
|
||||
Reference in new issue
Block a user