Skip to content

Commit 8d2e8b3

Browse files
committed
bump
1 parent 8dc8985 commit 8d2e8b3

5 files changed

Lines changed: 24 additions & 9 deletions

File tree

OpenFlowNodeRED/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openflow-nodered",
3-
"version": "1.1.35",
3+
"version": "1.1.36",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

OpenFlowNodeRED/src/node-red-contrib-openflow-storage.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Config } from "./Config";
77
import { WebSocketClient, NoderedUtil, Base } from "openflow-api";
88
import * as nodered from "node-red";
99
import { FileSystemCache } from "openflow-api";
10-
import { StopService, StartService, servicename } from "./nodeclient/cliutil";
10+
import { RestartService, servicename } from "./nodeclient/cliutil";
1111
export class noderednpmrc {
1212
public _id: string;
1313
public _type: string = "npmrc";
@@ -740,8 +740,7 @@ export class noderedcontribopenflowstorage {
740740
if (servicename != "service-name-not-set") {
741741
var _servicename = path.basename(servicename)
742742
this._logger.info("Restarting service " + _servicename);
743-
StopService(_servicename);
744-
StartService(_servicename);
743+
RestartService(_servicename);
745744
process.exit(1);
746745
} else {
747746
this._logger.info("Not running in docker, nor started as a service, please restart Node-Red manually");
@@ -801,7 +800,10 @@ export class noderedcontribopenflowstorage {
801800
const key = keys[i];
802801
if (key != "node-red") {
803802
const val = settings.nodes[key];
804-
if (val.pending_version) {
803+
if (val == null) {
804+
this._logger.info("noderedcontribopenflowstorage::_saveSettings:: key " + key + " is null?");
805+
} else if (val.pending_version) {
806+
this._logger.info("noderedcontribopenflowstorage::_saveSettings:: key " + key + " has a pending_version " + val.pending_version);
805807
exitprocess = true;
806808
}
807809
}
@@ -814,8 +816,7 @@ export class noderedcontribopenflowstorage {
814816
if (servicename != "service-name-not-set") {
815817
var _servicename = path.basename(servicename)
816818
this._logger.info("Restarting service " + _servicename);
817-
StopService(_servicename);
818-
StartService(_servicename);
819+
RestartService(_servicename);
819820
process.exit(1);
820821
} else {
821822
this._logger.info("Not running in docker, nor started as a service, please restart Node-Red manually");

OpenFlowNodeRED/src/nodeclient/cliutil.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ export function StopService(servicename: string) {
5050
logger.info(error.message);
5151
}
5252
}
53+
export function RestartService(servicename: string) {
54+
try {
55+
if (isWin()) {
56+
cp.execSync(`net stop "${servicename}" & net start "${servicename}"`);
57+
} else if (isMac()) {
58+
// https://medium.com/craftsmenltd/building-a-cross-platform-background-service-in-node-js-791cfcd3be60
59+
// cp.execSync(`sudo launchctl unload ${LAUNCHD_PLIST_PATH}`);
60+
} else {
61+
cp.execSync(`service ${servicename} restart`);
62+
}
63+
} catch (error) {
64+
logger.info(error.message);
65+
}
66+
}
5367
export function RemoveService(servicename: string) {
5468
StopService(servicename);
5569
logger.info("Uninstalling service" + servicename);

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.35
1+
1.1.36

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openiap",
3-
"version": "1.1.35",
3+
"version": "1.1.36",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)