Skip to content

Commit

Permalink
Merge pull request #2226 from codefori/feature/cancel_connectirng
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam authored Aug 26, 2024
2 parents 9fdb3ea + af6e7d6 commit 360778b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,19 @@ export default class IBMi {
return await vscode.window.withProgress({
location: vscode.ProgressLocation.Notification,
title: `Connecting`,
}, async progress => {
cancellable: true
}, async (progress, cancelToken) => {
progress.report({
message: `Connecting via SSH.`
});
const delayedOperations: Function[] = [...onConnectedOperations];

await this.client.connect(connectionObject as node_ssh.Config);

cancelToken.onCancellationRequested(() => {
this.end();
});

this.currentConnectionName = connectionObject.name;
this.currentHost = connectionObject.host;
this.currentPort = connectionObject.port;
Expand Down Expand Up @@ -917,7 +922,7 @@ export default class IBMi {
//Compute the maximum admited length of a command's arguments. Source: Googling and https://www.in-ulm.de/~mascheck/various/argmax/#effectively_usable
this.maximumArgsLength = Number((await this.sendCommand({ command: "/QOpenSys/usr/bin/expr `/QOpenSys/usr/bin/getconf ARG_MAX` - `env|wc -c` - `env|wc -l` \\* 4 - 2048" })).stdout);
}
else{
else {
this.maximumArgsLength = cachedServerSettings.maximumArgsLength;
}

Expand Down

0 comments on commit 360778b

Please sign in to comment.