Skip to content

Commit

Permalink
Allow tasks to run concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Dec 6, 2023
1 parent 08ce403 commit 66c1f86
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ const processUser = (user: Users.User) =>
}

yield* _(
Effect.forEach(
decisions,
Match.valueTags({
AddReviewToProfile: decision =>
Effect.logWarning('Need to add review').pipe(Effect.annotateLogs('doi', decision.doi)),
RemoveReviewFromProfile: decision =>
Effect.logWarning('Need to remove review').pipe(Effect.annotateLogs('doi', decision.doi)),
}),
Effect.all(
ReadonlyArray.map(
decisions,
Match.valueTags({
AddReviewToProfile: decision =>
Effect.logWarning('Need to add review').pipe(Effect.annotateLogs('doi', decision.doi)),
RemoveReviewFromProfile: decision =>
Effect.logWarning('Need to remove review').pipe(Effect.annotateLogs('doi', decision.doi)),
}),
),
{ concurrency: 'inherit' },
),
)
}).pipe(
Expand Down

0 comments on commit 66c1f86

Please sign in to comment.