This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
scorekeeper/jobs/specificJobs Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -208,4 +208,4 @@ export const USE_NOMINATIONS = true;
208208export const USE_RPC = true ;
209209export const USE_CLIENT = true ;
210210
211- export const MAX_ERAS_POINTS = 85 ;
211+ export const ERAPOINTS_JOB_MAX_ERAS = 84 ;
Original file line number Diff line number Diff line change @@ -63,20 +63,15 @@ export const eraPointsJob = async (
6363 // - if a record doesn't exist, create it
6464 const [ activeEra , err ] = await chaindata . getActiveEraIndex ( ) ;
6565
66- // Calculate total number of eras to process
67- const totalEras = activeEra ;
68- let processedEras = 0 ;
69-
7066 for (
71- let i = activeEra - 1 ;
72- i >= activeEra - Constants . MAX_ERAS_POINTS ;
73- i --
67+ let i = activeEra - 1 , processedEras = 1 ;
68+ i >= activeEra - Constants . ERAPOINTS_JOB_MAX_ERAS ;
69+ i -- , processedEras ++
7470 ) {
7571 await individualEraPointsJob ( chaindata , i ) ;
7672
7773 // Calculate progress percentage
78- processedEras ++ ;
79- const progress = ( processedEras / totalEras ) * 100 ;
74+ const progress = ( processedEras / Constants . ERAPOINTS_JOB_MAX_ERAS ) * 100 ;
8075
8176 // Emit progress update with active era as iteration
8277 jobStatusEmitter . emit ( "jobProgress" , {
You can’t perform that action at this time.
0 commit comments