mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Retry auto-install of modules that fail
- introduces autoInstallModulesRetry - default 30000 - backs off interval if repeated failures - fixes notification to the editor of an auto-reinstall
This commit is contained in:
@@ -22,7 +22,6 @@ var sinon = require('sinon');
|
||||
var when = require('when');
|
||||
|
||||
var nodes = require("../../../red/api/nodes");
|
||||
var comms = require("../../../red/api/comms");
|
||||
var locales = require("../../../red/api/locales");
|
||||
|
||||
describe("nodes api", function() {
|
||||
@@ -35,6 +34,9 @@ describe("nodes api", function() {
|
||||
info: function(){},
|
||||
warn: function(){}
|
||||
}
|
||||
runtime.events = {
|
||||
emit: function(){}
|
||||
}
|
||||
nodes.init(runtime);
|
||||
|
||||
}
|
||||
@@ -49,15 +51,11 @@ describe("nodes api", function() {
|
||||
app.put(/\/nodes\/((@[^\/]+\/)?[^\/]+)$/,nodes.putModule);
|
||||
app.put(/\/nodes\/((@[^\/]+\/)?[^\/]+)\/([^\/]+)$/,nodes.putSet);
|
||||
app.delete("/nodes/:id",nodes.delete);
|
||||
sinon.stub(comms,"publish");
|
||||
sinon.stub(locales,"determineLangFromHeaders", function() {
|
||||
return "en-US";
|
||||
});
|
||||
});
|
||||
|
||||
after(function() {
|
||||
comms.publish.restore();
|
||||
});
|
||||
|
||||
describe('get nodes', function() {
|
||||
it('returns node list', function(done) {
|
||||
|
@@ -141,7 +141,7 @@ describe("runtime", function() {
|
||||
{ module:"node-red",enabled:true,loaded:false,types:["typeC","typeD"]} // missing
|
||||
].filter(cb);
|
||||
});
|
||||
var serverInstallModule = sinon.stub(redNodes,"installModule",function(name) { return when.resolve();});
|
||||
var serverInstallModule = sinon.stub(redNodes,"installModule",function(name) { return when.resolve({nodes:[]});});
|
||||
runtime.init({testSettings: true, autoInstallModules:true, httpAdminRoot:"/", load:function() { return when.resolve();}});
|
||||
sinon.stub(console,"log");
|
||||
runtime.start().then(function() {
|
||||
|
Reference in New Issue
Block a user