File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,11 +159,16 @@ class Client {
159159 try {
160160 const res = await axios . get ( url )
161161 const data = res . data
162- for ( const item of data ) {
163- await this . fetchConfigFromDbByNamespace ( item . namespaceName )
164- this . notifications [ item . namespaceName ] = item . notificationId
162+ if ( data ) {
163+ for ( const item of data ) {
164+ await this . fetchConfigFromDbByNamespace ( item . namespaceName )
165+ this . notifications [ item . namespaceName ] = item . notificationId
166+ }
165167 }
166168 } catch ( error ) {
169+ if ( + get ( error , 'response.status' ) === 304 ) {
170+ return
171+ }
167172 this . error ( 'pollingNotification error: ' , error . message )
168173 }
169174 }
Original file line number Diff line number Diff line change 1- const axios = require ( 'axios' ) ;
1+ const axios = require ( 'axios' )
22
3- exports . axios = axios . default ;
3+ // axios.interceptors.response.use(function (response) {
4+ // return response
5+ // }, function (error) {
6+ // // console.log('error1111111111111111111111111', error)
7+ // // if (error.response && +error.response.status === 304) {
8+ // // return Promise.reject(new Error('304'))
9+ // // }
10+ // return Promise.reject(error)
11+ // })
12+
13+ exports . axios = axios . default
You can’t perform that action at this time.
0 commit comments