fix: remove unwanted error logging

This commit is contained in:
Justin Lin committed 2024-12-27 20:56:23 +08:00
1 parent 019caf58e4
commit 9e44ebe415
1 file changed
+3 -2
+3 -2
View File
@@ -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) {