Skip to content

Commit

Permalink
removed unnecessary imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JTSIV1 committed Mar 21, 2024
1 parent 02f81c3 commit f99c844
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/Supervisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import connectionPool from "./connectors/ConnectionPool";
import * as events from "events";
import DB from "./DB";
import NodeSSH = require("node-ssh");
import BaseConnector from "./connectors/BaseConnector";
import { Console } from "console";
import Helper from "./Helper";

class Supervisor {
Expand Down Expand Up @@ -140,12 +138,23 @@ class Supervisor {
}

if (!ssh.connection.isConnected()) {
await Helper.runCommandWithBackoff(async (ssh1: SSH) => {
if (!ssh1.connection.isConnected()) {
await ssh1.connection.connect(ssh1.config);
}
ssh1.connection.execCommand("echo");
}, [ssh], null);
try {
// wraps command with backoff -> takes lambda function and array of inputs to execute command
await Helper.runCommandWithBackoff(async (ssh1: SSH) => {
if (!ssh1.connection.isConnected()) {
await ssh1.connection.connect(ssh1.config);
}
ssh1.connection.execCommand("echo");
}, [ssh], null);
} catch (e) {
console.log(`job [${job.id}]: Caught ${e}`)
self.emitter.registerEvents(
job,
"JOB_FAILED",
`job [${job.id}] failed because the HPC could not connect within the allotted time`
);
}

}

if (job.maintainerInstance.isInit) {
Expand Down

0 comments on commit f99c844

Please sign in to comment.