function stop() {
    if (runtimeMetricInterval) {
        clearInterval(runtimeMetricInterval);
        runtimeMetricInterval = null;
    }
    if (reinstallTimeout) {
        clearTimeout(reinstallTimeout);
    }
    started = false;
    return redNodes.stopFlows().then(function(){
        return redNodes.closeContextsPlugin();
    });
}
Stops the runtime.

Once called, Node-RED should not be restarted until the Node.JS process is
restarted.

@return {Promise} - resolves when the runtime is stopped.
@memberof @node-red/runtime