File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "ts-node" : " ^10.9.1" ,
2626 "typescript" : " ^5.0.2"
2727 },
28- "dependencies" : {
28+ "dependencies" : {
29+ "@octokit/auth-app" : " 4.0.13" ,
2930 "@octokit/plugin-throttling" : " ^5.0.1" ,
3031 "axios" : " ^1.4.0" ,
32+ "axios-retry" : " ^3.5.0" ,
3133 "dotenv" : " ^16.0.3" ,
3234 "express" : " ^4.18.2" ,
3335 "js-yaml" : " ^4.1.0" ,
3436 "ldap-escape" : " ^2.0.6" ,
3537 "ldapjs" : " ^3.0.1" ,
3638 "octokit" : " ^2.0.14" ,
3739 "openapi-backend" : " ^5.9.1" ,
38- "swagger-ui-express" : " ^4.6.2" ,
39- "@octokit/auth-app" : " 4.0.13"
40+ "swagger-ui-express" : " ^4.6.2"
4041 },
4142 "nodemonConfig" : {
4243 "watch" : [
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Config } from "../config";
22import ldap from "ldapjs" ;
33import ldapEscape from "ldap-escape" ;
44import axios from "axios" ;
5+ import axiosRetry from "axios-retry" ;
56
67const config = Config ( )
78
@@ -133,7 +134,12 @@ async function ForwardSearch(groupName: string) {
133134
134135 console . log ( `Retrieving group (${ groupName } ) information from '${ requestUrl } '` ) ;
135136 try {
136- const result = await axios . get ( requestUrl ) ;
137+ // TODO: do not directly use axios.create from within a function like this
138+ // it will cause a new client to be made per request.
139+ const client = axios . create ( ) ;
140+ axiosRetry ( client , { retries : 5 } ) ;
141+
142+ const result = await client . get ( requestUrl ) ;
137143 console . log ( `Results for ${ groupName } : ${ result } ` ) ;
138144 return result . data as SearchAllResponse ;
139145 }
You can’t perform that action at this time.
0 commit comments