File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,6 @@ export const instListSubscription: IfcPVWSRequest = {
99 type : PVWSRequestType . subscribe ,
1010 pvs : [ instListPV ] ,
1111} ;
12+
13+ export const webSocketReconnectInterval = 5000 ; // ms
14+ export const webSocketReconnectAttempts = 100000 ;
Original file line number Diff line number Diff line change @@ -19,7 +19,13 @@ import {
1919 yesToBoolean ,
2020} from "@/app/components/Instrument" ;
2121import useWebSocket from "react-use-websocket" ;
22- import { instListPV , instListSubscription , socketURL } from "@/app/commonVars" ;
22+ import {
23+ instListPV ,
24+ instListSubscription ,
25+ socketURL ,
26+ webSocketReconnectAttempts ,
27+ webSocketReconnectInterval ,
28+ } from "@/app/commonVars" ;
2329import {
2430 dehex_and_decompress ,
2531 instListFromBytes ,
@@ -176,8 +182,8 @@ export function InstrumentData({ instrumentName }: { instrumentName: string }) {
176182 } ,
177183 share : true ,
178184 retryOnError : true ,
179- reconnectInterval : 5000 ,
180- reconnectAttempts : 1000 ,
185+ reconnectInterval : webSocketReconnectInterval ,
186+ reconnectAttempts : webSocketReconnectAttempts ,
181187 } ) ;
182188
183189 if ( ! currentInstrument ) {
Original file line number Diff line number Diff line change @@ -7,7 +7,13 @@ import {
77 PVWSRequestType ,
88} from "@/app/types" ;
99import useWebSocket from "react-use-websocket" ;
10- import { instListPV , instListSubscription , socketURL } from "@/app/commonVars" ;
10+ import {
11+ instListPV ,
12+ instListSubscription ,
13+ socketURL ,
14+ webSocketReconnectAttempts ,
15+ webSocketReconnectInterval ,
16+ } from "@/app/commonVars" ;
1117import { instListFromBytes } from "@/app/components/dehex_and_decompress" ;
1218import TargetStation from "@/app/components/TargetStation" ;
1319import ScienceGroup from "@/app/components/ScienceGroup" ;
@@ -116,8 +122,8 @@ export default function InstrumentsDisplay({
116122 } ,
117123 share : true ,
118124 retryOnError : true ,
119- reconnectInterval : 5000 ,
120- reconnectAttempts : 1000 ,
125+ reconnectInterval : webSocketReconnectInterval ,
126+ reconnectAttempts : webSocketReconnectAttempts ,
121127 } ) ;
122128
123129 return (
You can’t perform that action at this time.
0 commit comments