Skip to content

Commit

Permalink
Do not reset timeout
Browse files Browse the repository at this point in the history
The problem is that the timeout will not apply to reconnects.
  • Loading branch information
code-asher committed May 24, 2024
1 parent 396d05d commit d7fd4ac
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export class Remote {
// write here is not necessarily catastrophic since the user will be
// asked for the platform and the default timeout might be sufficient.
mungedPlatforms = mungedConnTimeout = false
this.storage.writeToCoderOutputChannel(`Failed to configure settings: ${ex}`)
}
}

Expand Down Expand Up @@ -485,23 +486,6 @@ export class Remote {
}

this.findSSHProcessID().then((pid) => {
// Once the SSH process has spawned we can reset the timeout.
if (mungedConnTimeout) {
// Re-read settings in case they changed.
fs.readFile(this.storage.getUserSettingsPath(), "utf8").then(async (rawSettings) => {
try {
await fs.writeFile(
this.storage.getUserSettingsPath(),
jsonc.applyEdits(rawSettings, jsonc.modify(rawSettings, ["remote.SSH.connectTimeout"], connTimeout, {})),
)
} catch (error) {
this.storage.writeToCoderOutputChannel(
`Failed to reset remote.SSH.connectTimeout back to ${connTimeout}: ${error}`,
)
}
})
}

if (!pid) {
// TODO: Show an error here!
return
Expand Down

0 comments on commit d7fd4ac

Please sign in to comment.