MCPcopy
hub / github.com/pstadler/flightplan / connect

Function connect

lib/flight/remote.js:11–34  ·  view source on GitHub ↗
(_context)

Source from the content-addressed store, hash-verified

9var _connections = [];
10
11function connect(_context) {
12 var future = new Future();
13
14 new Fiber(function() {
15 logger.info("Connecting to '" + _context.remote.host + "'");
16
17 try {
18 var connection = new SSH(_context);
19 _connections.push(connection);
20 } catch(e) {
21 if(!_context.remote.failsafe) {
22 throw new errors.ConnectionFailedError("Error connecting to '" +
23 _context.remote.host + "': " + e.message);
24 }
25
26 logger.warn("Safely failed connecting to '" +
27 _context.remote.host + "': " + e.message);
28 }
29
30 return future.return();
31 }).run();
32
33 return future;
34}
35
36function execute(transport, fn) {
37 var future = new Future();

Callers 1

remote.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected