mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
@@ -378,15 +378,23 @@ function getActiveProject(user) {
|
||||
}
|
||||
|
||||
function reloadActiveProject(action) {
|
||||
// Stop the current flows
|
||||
return runtime.nodes.stopFlows().then(function() {
|
||||
return runtime.nodes.loadFlows(true).then(function() {
|
||||
events.emit("runtime-event",{id:"project-update", payload:{ project: activeProject.name, action:action}});
|
||||
}).catch(function(err) {
|
||||
// We're committed to the project change now, so notify editors
|
||||
// that it has changed.
|
||||
events.emit("runtime-event",{id:"project-update", payload:{ project: activeProject.name, action:action}});
|
||||
throw err;
|
||||
});
|
||||
// Reset context to remove any old values
|
||||
return runtime.nodes.clearContext().then(function() {
|
||||
// Load the new project flows and start them
|
||||
return runtime.nodes.loadFlows(true).then(function() {
|
||||
events.emit("runtime-event",{id:"project-update", payload:{ project: activeProject.name, action:action}});
|
||||
}).catch(function(err) {
|
||||
// We're committed to the project change now, so notify editors
|
||||
// that it has changed.
|
||||
events.emit("runtime-event",{id:"project-update", payload:{ project: activeProject.name, action:action}});
|
||||
throw err;
|
||||
});
|
||||
})
|
||||
}).catch(function(err) {
|
||||
console.log(err.stack);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
function createProject(user, metadata) {
|
||||
|
Reference in New Issue
Block a user