Skip to content

Commit

Permalink
feature/add-governance-action-worker-job: removed redundant if statem…
Browse files Browse the repository at this point in the history
…ent and refactored for loop iteration condition
  • Loading branch information
BEdev24 committed Jun 27, 2024
1 parent a486b28 commit b1d3445
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ export class GovActionProposalFacade {
await this.govActionProposalService.getGovActionProposalIds();

if (govActionProposalIdsArray.length > 0) {
for (let i = 0; i <= govActionProposalIdsArray.length + 10; i += 10) {
if (i >= govActionProposalIdsArray.length) {
break;
}
for (let i = 0; i <= govActionProposalIdsArray.length; i += 10) {
const chunk: object[] = govActionProposalIdsArray.slice(i, i + 10);
const govActionProposalIdsValues: string[] = chunk.map(
(obj) => (obj as any).id,
Expand All @@ -35,4 +32,7 @@ export class GovActionProposalFacade {
}
}
}
async delay(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
}

0 comments on commit b1d3445

Please sign in to comment.