File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,30 +107,12 @@ async function SearchAllAsyncNoExceptionHandling(groupName: string): SearchAllRe
107107 // }
108108 // })
109109 } ) ;
110- }
111-
112- async function SearchAllAsyncInternal ( groupName : string ) : SearchAllResponse {
113- try {
114- return await SearchAllAsyncNoExceptionHandling ( groupName ) ;
115- }
116- catch {
117- return {
118- entries : [ ] as Entry [ ] ,
119- referrals : [ ]
120- }
121- }
122- }
110+ }
123111
124112export async function SearchAllAsync ( groupName : string ) : SearchAllResponse {
125113 try {
126114 if ( process . env . SOURCE_PROXY ) {
127- console . log ( `Forwarding request to '${ process . env . SOURCE_PROXY } '` ) ;
128-
129- const requestUrl = `${ process . env . SOURCE_PROXY } /api/get-source-team?teamName=${ groupName } `
130-
131- const result = await axios . get ( requestUrl ) ;
132-
133- return result . data ;
115+ return await ForwardSearch ( groupName ) ;
134116 }
135117
136118 return await SearchAllAsyncNoExceptionHandling ( groupName ) ;
@@ -141,4 +123,15 @@ export async function SearchAllAsync(groupName: string): SearchAllResponse {
141123 referrals : [ ]
142124 }
143125 }
144- }
126+ }
127+
128+ async function ForwardSearch ( groupName : string ) {
129+ console . log ( `Forwarding request to '${ process . env . SOURCE_PROXY } '` ) ;
130+
131+ // cb is for cache busting.
132+ const requestUrl = `${ process . env . SOURCE_PROXY } /api/get-source-team?teamName=${ groupName } &cb=${ Date . now ( ) } ` ;
133+
134+ const result = await axios . get ( requestUrl ) ;
135+
136+ return result . data ;
137+ }
You can’t perform that action at this time.
0 commit comments