@@ -75,13 +75,15 @@ export class CoreMosDeviceHandler {
75
75
private _pendingStoryItemChanges : Array < IStoryItemChange > = [ ]
76
76
private _pendingChangeTimeout : number = 60 * 1000
77
77
private mosTypes : MosTypes
78
+ private _hotStandby : boolean
78
79
79
80
private _messageQueue : Queue
80
81
81
- constructor ( parent : CoreHandler , mosDevice : IMOSDevice , mosHandler : MosHandler ) {
82
+ constructor ( parent : CoreHandler , mosDevice : IMOSDevice , mosHandler : MosHandler , hotStandby : boolean ) {
82
83
this . _coreParentHandler = parent
83
84
this . _mosDevice = mosDevice
84
85
this . _mosHandler = mosHandler
86
+ this . _hotStandby = hotStandby
85
87
86
88
this . _messageQueue = new Queue ( )
87
89
@@ -138,25 +140,39 @@ export class CoreMosDeviceHandler {
138
140
let statusCode : StatusCode
139
141
const messages : Array < string > = [ ]
140
142
141
- if ( connectionStatus . PrimaryConnected ) {
142
- if ( connectionStatus . SecondaryConnected || ! this . _mosDevice . idSecondary ) {
143
+ if ( this . _hotStandby ) {
144
+ if ( connectionStatus . PrimaryConnected ) {
143
145
statusCode = StatusCode . GOOD
144
146
} else {
145
- statusCode = StatusCode . WARNING_MINOR
147
+ if ( connectionStatus . SecondaryConnected ) {
148
+ statusCode = StatusCode . GOOD
149
+ messages . push ( connectionStatus . SecondaryStatus || 'Running NRCS on hot standby' )
150
+ } else {
151
+ statusCode = StatusCode . BAD
152
+ messages . push ( connectionStatus . SecondaryStatus || 'Primary and hot standby are not connected' )
153
+ }
146
154
}
147
155
} else {
148
- if ( connectionStatus . SecondaryConnected ) {
149
- statusCode = StatusCode . WARNING_MAJOR
156
+ if ( connectionStatus . PrimaryConnected ) {
157
+ if ( connectionStatus . SecondaryConnected || ! this . _mosDevice . idSecondary ) {
158
+ statusCode = StatusCode . GOOD
159
+ } else {
160
+ statusCode = StatusCode . WARNING_MINOR
161
+ }
150
162
} else {
151
- statusCode = StatusCode . BAD
163
+ if ( connectionStatus . SecondaryConnected ) {
164
+ statusCode = StatusCode . WARNING_MAJOR
165
+ } else {
166
+ statusCode = StatusCode . BAD
167
+ }
152
168
}
153
- }
154
169
155
- if ( ! connectionStatus . PrimaryConnected ) {
156
- messages . push ( connectionStatus . PrimaryStatus || 'Primary not connected' )
157
- }
158
- if ( this . _mosDevice . idSecondary && ! connectionStatus . SecondaryConnected ) {
159
- messages . push ( connectionStatus . SecondaryStatus || 'Fallback not connected' )
170
+ if ( ! connectionStatus . PrimaryConnected ) {
171
+ messages . push ( connectionStatus . PrimaryStatus || 'Primary not connected' )
172
+ }
173
+ if ( this . _mosDevice . idSecondary && ! connectionStatus . SecondaryConnected ) {
174
+ messages . push ( connectionStatus . SecondaryStatus || 'Fallback not connected' )
175
+ }
160
176
}
161
177
162
178
this . core
0 commit comments