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:
@@ -58,7 +58,7 @@ function init(runtime) {
|
||||
log.info(log._("nodes.flows.registered-missing", {type:type}));
|
||||
activeFlowConfig.missingTypes.splice(i,1);
|
||||
if (activeFlowConfig.missingTypes.length === 0 && started) {
|
||||
events.emit("runtime-event",{id:"runtime-state"});
|
||||
events.emit("runtime-event",{id:"runtime-state",retain: true});
|
||||
start();
|
||||
}
|
||||
}
|
||||
@@ -135,13 +135,13 @@ function setFlows(_config,type,muteLog) {
|
||||
return stop(type,diff,muteLog).then(function() {
|
||||
context.clean(activeFlowConfig);
|
||||
start(type,diff,muteLog).then(function() {
|
||||
events.emit("runtime-event",{id:"runtime-deploy",revision:flowRevision});
|
||||
events.emit("runtime-event",{id:"runtime-deploy",payload:{revision:flowRevision},retain: true});
|
||||
});
|
||||
return flowRevision;
|
||||
}).otherwise(function(err) {
|
||||
})
|
||||
} else {
|
||||
events.emit("runtime-event",{id:"runtime-deploy",revision:flowRevision});
|
||||
events.emit("runtime-event",{id:"runtime-deploy",payload:{revision:flowRevision},retain: true});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -251,7 +251,7 @@ function start(type,diff,muteLog) {
|
||||
log.info(log._("nodes.flows.missing-type-install-2"));
|
||||
log.info(" "+settings.userDir);
|
||||
}
|
||||
events.emit("runtime-event",{id:"runtime-state",type:"warning",text:"notification.warnings.missing-types"});
|
||||
events.emit("runtime-event",{id:"runtime-state",payload:{type:"warning",text:"notification.warnings.missing-types"},retain:true});
|
||||
return when.resolve();
|
||||
}
|
||||
if (!muteLog) {
|
||||
@@ -310,7 +310,7 @@ function start(type,diff,muteLog) {
|
||||
}
|
||||
}
|
||||
events.emit("nodes-started");
|
||||
events.emit("runtime-event",{id:"runtime-state"});
|
||||
events.emit("runtime-event",{id:"runtime-state",retain:true});
|
||||
|
||||
if (!muteLog) {
|
||||
if (type !== "full") {
|
||||
|
@@ -30,8 +30,6 @@ var library = require("./library");
|
||||
|
||||
var events = require("../events");
|
||||
|
||||
var child_process = require('child_process');
|
||||
|
||||
var settings;
|
||||
|
||||
/**
|
||||
|
@@ -131,7 +131,7 @@ function installModule(module,version) {
|
||||
resolve(require("./index").addModule(module).then(reportAddedModules));
|
||||
} else {
|
||||
log.info(log._("server.install.upgraded",{name:module, version:version}));
|
||||
events.emit("runtime-event",{id:"restart-required",type:"warning",text:"notification.warnings.restartRequired"});
|
||||
events.emit("runtime-event",{id:"restart-required",payload:{type:"warning",text:"notification.warnings.restartRequired"},retain:true});
|
||||
resolve(require("./registry").setModulePendingUpdated(module,version));
|
||||
}
|
||||
}
|
||||
|
@@ -128,7 +128,7 @@ function saveNodeList() {
|
||||
}
|
||||
}
|
||||
if (hadPending && !hasPending) {
|
||||
events.emit("runtime-event",{id:"restart-required"});
|
||||
events.emit("runtime-event",{id:"restart-required",retain: true});
|
||||
}
|
||||
if (settings.available()) {
|
||||
return settings.set("nodes",moduleList);
|
||||
|
Reference in New Issue
Block a user