bug fixed with no heartbeat
This commit is contained in:
1 parent
aa63762757
commit
e443166ce3
1 file changed
+15
@@ -96,6 +96,7 @@ function newUiObject () {
|
||||
|
||||
let eventSubscriptionIdHeartbeat
|
||||
let eventSubscriptionIdOnStopped
|
||||
let lastHeartBeat
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -143,6 +144,7 @@ function newUiObject () {
|
||||
icon = undefined
|
||||
chainAttachToNode = undefined
|
||||
referenceAttachToNode = undefined
|
||||
lastHeartBeat = undefined
|
||||
}
|
||||
|
||||
function initialize (payload, menuItemsInitialValues) {
|
||||
@@ -280,6 +282,17 @@ function newUiObject () {
|
||||
childrenRunningPhysics()
|
||||
}
|
||||
|
||||
function heartBeatPhysics () {
|
||||
if (lastHeartBeat !== undefined) {
|
||||
const ONE_MIN = 60000
|
||||
nowTimestamp = (new Date()).valueOf()
|
||||
if (nowTimestamp - lastHeartBeat.valueOf() > ONE_MIN) {
|
||||
lastHeartBeat = undefined
|
||||
thisObject.isRunning = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function childrenRunningPhysics () {
|
||||
let nodeDefinition = APP_SCHEMA_MAP.get(thisObject.payload.node.type)
|
||||
if (nodeDefinition.properties === undefined) { return }
|
||||
@@ -634,6 +647,7 @@ function newUiObject () {
|
||||
|
||||
function onHeartBeat () {
|
||||
if (thisObject.payload === undefined) { return }
|
||||
lastHeartBeat = new Date()
|
||||
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
|
||||
systemEventHandler.stopListening(key, eventSubscriptionIdHeartbeat, 'UiObject')
|
||||
|
||||
@@ -681,6 +695,7 @@ function newUiObject () {
|
||||
thisObject.circularProgressBar = undefined
|
||||
}
|
||||
thisObject.isRunning = false
|
||||
lastHeartBeat = undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user