Skip to content

Commit

Permalink
Merge pull request #511 from prey/fix-connection-startup
Browse files Browse the repository at this point in the history
fix when starting node client
  • Loading branch information
JohaoRosasRosillo authored Aug 13, 2021
2 parents 6c18534 + 94724a5 commit 91d63a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
14 changes: 4 additions & 10 deletions lib/agent/plugins/control-panel/long-polling/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,17 @@ function load_hooks() {
}
});


hooks.on('connected', function() {
fileretrieval.check_pending_files();
triggers.start();
});

hooks.on('network_state_changed', function() {
clear_current_request();
});

re_schedule = true;
loaded = true;
request();

hooks.on('providers_ready', () => {
request();
})
}

var unload = function() {
Expand All @@ -302,10 +300,6 @@ var unload = function() {
loaded = false;
};

exports.check = function() {
request();
};

exports.load = function(cb) {
lp_conf.unload();

Expand Down
3 changes: 2 additions & 1 deletion lib/agent/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ var map = exports.map = function(cb){

});

hooks.trigger('providers_ready');

cb(null, getters_list);
});

};

/**
* providers.get takes care of calling a specified provider and either
* calling the callback with the result or firing an error or data event
Expand Down

0 comments on commit 91d63a9

Please sign in to comment.