-
Notifications
You must be signed in to change notification settings - Fork 2
[#177116930] Add EYCA expiration process #41
Conversation
Affected stories
|
Codecov Report
@@ Coverage Diff @@
## master #41 +/- ##
==========================================
+ Coverage 82.89% 84.55% +1.65%
==========================================
Files 36 43 +7
Lines 1076 1347 +271
Branches 121 145 +24
==========================================
+ Hits 892 1139 +247
- Misses 179 203 +24
Partials 5 5
Continue to review full report at Codecov.
|
UpdateExpiredEyca/handler.ts
Outdated
// tslint:disable-next-line: readonly-array | ||
const taskArray = []; | ||
const tasksChunks = chunksOf(tasks, 100); | ||
for (const tasksChunk of tasksChunks) { | ||
taskArray.push( | ||
array | ||
.sequence(taskEither)(tasksChunk) | ||
.run() | ||
); | ||
} | ||
return Promise.all([...taskArray]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer immutable array when possible
// tslint:disable-next-line: readonly-array | |
const taskArray = []; | |
const tasksChunks = chunksOf(tasks, 100); | |
for (const tasksChunk of tasksChunks) { | |
taskArray.push( | |
array | |
.sequence(taskEither)(tasksChunk) | |
.run() | |
); | |
} | |
return Promise.all([...taskArray]); | |
return Promise.all( | |
chunksOf(tasks, 100).map(_ => | |
array | |
.sequence(taskEither)(_) | |
.run() | |
) | |
); |
// Now we try to start Expire operation | ||
return tryCatch( | ||
() => | ||
client.startNew( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the orchestration start fail? We have no retry here and the card remains unapdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a good point. I guess that in this case we must raise an alert with trackException
below and proceed to change the state with a script. Another possibility is to create a queue that can retry the expiration process. What do you think about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart some minor unit tests improvements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
List of Changes
UpdateExpiredEyca
triggerExpireEycaOrchestrator
ExpireEycaActivity
Motivation and Context
n EYCA card must expires after a citizen has reached 31 years old, so it' necessary to schedule a trigger that could do this job, intended for:
EXPIRED
Please refer to related story for further informations.
How Has This Been Tested?
It has been tested by performing unit tests.
Types of changes
Checklist: