File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -148,12 +148,13 @@ async function syncUsers(fast42Api: Fast42, lastPullDate: Date | undefined): Pro
148148 const campuses = await DatabaseService . getAllCampuses ( ) ;
149149 let campusIds = campuses . map ( c => c . id ) ;
150150 try {
151- for ( const campusId of campusIds ) {
151+ const totalCampuses = campusIds . length ;
152+ for ( let [ index , campusId ] of campusIds . entries ( ) ) {
152153 params [ 'filter[primary_campus_id]' ] = campusId . toString ( ) ;
153154 while ( hasMorePages ) {
154155 pageIndex ++ ;
155156 params [ 'page[number]' ] = pageIndex . toString ( ) ;
156- log ( 2 , `Fetching page ${ pageIndex } of users for campus ${ campusId } ...` ) ;
157+ log ( 2 , `Fetching page ${ pageIndex } of users for campus ${ campusId } ( ${ index + 1 } / ${ totalCampuses } ) ...` ) ;
157158
158159 let usersData ;
159160 try {
@@ -203,11 +204,12 @@ async function syncProjectUsers(fast42Api: Fast42, lastPullDate: Date | undefine
203204 const projects = await DatabaseService . getAllProjects ( ) ;
204205 let projectIds = projects . map ( p => p . id ) ;
205206 try {
206- for ( const projectId of projectIds ) {
207+ const totalProjects = projectIds . length ;
208+ for ( let [ index , projectId ] of projectIds . entries ( ) ) {
207209 while ( hasMorePages ) {
208210 pageIndex ++ ;
209211 params [ 'page[number]' ] = pageIndex . toString ( ) ;
210- log ( 2 , `Fetching page ${ pageIndex } of projectUsers...` ) ;
212+ log ( 2 , `Fetching page ${ pageIndex } of projectUsers for project ${ projectId } ( ${ index + 1 } / ${ totalProjects } ) ...` ) ;
211213
212214 let projectUsersData ;
213215 try {
You can’t perform that action at this time.
0 commit comments