@@ -1625,21 +1625,22 @@ async function sparkplugProcess(
1625
1625
return
1626
1626
}
1627
1627
Log . log ( logModS + 'Requesting node rebirth...' )
1628
- spClient . handle . publishNodeCmd (
1629
- topicInfo . groupId ,
1630
- topicInfo . edgeNodeId ,
1631
- {
1632
- timestamp : new Date ( ) . getTime ( ) ,
1633
- metrics : [
1634
- {
1635
- name : 'Node Control/Rebirth' ,
1636
- timestamp : new Date ( ) . getTime ( ) ,
1637
- type : 'Boolean' ,
1638
- value : true ,
1639
- } ,
1640
- ] ,
1641
- }
1642
- )
1628
+ if ( spClient ?. handle )
1629
+ spClient . handle . publishNodeCmd (
1630
+ topicInfo . groupId ,
1631
+ topicInfo . edgeNodeId ,
1632
+ {
1633
+ timestamp : new Date ( ) . getTime ( ) ,
1634
+ metrics : [
1635
+ {
1636
+ name : 'Node Control/Rebirth' ,
1637
+ timestamp : new Date ( ) . getTime ( ) ,
1638
+ type : 'Boolean' ,
1639
+ value : true ,
1640
+ } ,
1641
+ ] ,
1642
+ }
1643
+ )
1643
1644
return
1644
1645
}
1645
1646
ProcessNodeBirthOrData ( nodeLocator , payload , false , splTopic [ 2 ] )
@@ -1660,21 +1661,22 @@ async function sparkplugProcess(
1660
1661
logModS + 'Data from not yet birthed device: ' + deviceLocator
1661
1662
)
1662
1663
Log . log ( logModS + 'Requesting node rebirth...' )
1663
- spClient . handle . publishNodeCmd (
1664
- topicInfo . groupId ,
1665
- topicInfo . edgeNodeId ,
1666
- {
1667
- timestamp : new Date ( ) . getTime ( ) ,
1668
- metrics : [
1669
- {
1670
- name : 'Node Control/Rebirth' ,
1671
- timestamp : new Date ( ) . getTime ( ) ,
1672
- type : 'Boolean' ,
1673
- value : true ,
1674
- } ,
1675
- ] ,
1676
- }
1677
- )
1664
+ if ( spClient ?. handle )
1665
+ spClient . handle . publishNodeCmd (
1666
+ topicInfo . groupId ,
1667
+ topicInfo . edgeNodeId ,
1668
+ {
1669
+ timestamp : new Date ( ) . getTime ( ) ,
1670
+ metrics : [
1671
+ {
1672
+ name : 'Node Control/Rebirth' ,
1673
+ timestamp : new Date ( ) . getTime ( ) ,
1674
+ type : 'Boolean' ,
1675
+ value : true ,
1676
+ } ,
1677
+ ] ,
1678
+ }
1679
+ )
1678
1680
return
1679
1681
}
1680
1682
ProcessDeviceBirthOrData (
0 commit comments