File tree 1 file changed +3
-47
lines changed 1 file changed +3
-47
lines changed Original file line number Diff line number Diff line change @@ -82,53 +82,9 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
82
82
// Everytime we get a new proxiesResponse, update the latency check
83
83
// to each workspace proxy.
84
84
useEffect ( ( ) => {
85
- const latencyAxios = axios . create ( )
86
- latencyAxios . interceptors . request . use ( ( config ) => {
87
- config . data = config . data || { }
88
- config . data . startTime = new Date ( )
89
- console . log ( "Hey kira" , config , config . data )
90
- return config
91
- } )
92
-
93
- latencyAxios . interceptors . response . use (
94
- // Success 200
95
- ( x ) => {
96
- // Get elapsed time (in milliseconds)
97
- const end = new Date ( )
98
- x . config . data = {
99
- ...x . config . data ,
100
- ...{
101
- endTime : end ,
102
- responseTime : end . getTime ( ) - x . config . data . requestStartedAt ,
103
- } ,
104
- }
105
- return x
106
- } ,
107
- // Handle 4xx & 5xx responses
108
- ( x ) => {
109
- // Get elapsed time (in milliseconds)
110
- const end = new Date ( )
111
- x . config . data = x . config . data || {
112
- ...x . config . data ,
113
- ...{
114
- endTime : end ,
115
- responseTime : end . getTime ( ) - x . config . data . requestStartedAt ,
116
- } ,
117
- }
118
- return x
119
- } ,
120
- )
121
-
122
- // AgentLatency.tsx for colors
123
- console . log ( "update workspace proxies" , proxiesResp )
124
- latencyAxios
125
- . get < any > ( "/api/v2/users/authmethods" )
126
- . then ( ( resp ) => {
127
- console . log ( "latency" , resp )
128
- } )
129
- . catch ( ( err ) => {
130
- console . log ( "latency error" , err )
131
- } )
85
+ if ( ! proxiesResp ) {
86
+ return
87
+ }
132
88
} , [ proxiesResp ] )
133
89
134
90
const setAndSaveProxy = (
You can’t perform that action at this time.
0 commit comments