-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mojaloop/#2801): add fulfil timestamp validation and more error handling #916
Conversation
@@ -18,6 +18,7 @@ | |||
"CREATE_RETRY_INTERVAL_MILLIS": 200, | |||
"DEBUG": false | |||
}, | |||
"MAX_FULFIL_TIMEOUT_DURATION_SECONDS": 300, |
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.
I believe this is a breaking change right?
I.e. What is the impact if we do not provide the MAX_FULFIL_TIMEOUT_DURATION_SECONDS
config either via default.json or env file?
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.
There is a default timeout that it will default to https://github.com/mojaloop/central-ledger/pull/916/files#diff-b69d6bde1ed95b38264df8b79c66099602625f0eb541d4e98001baed223096d7R213 so it should work without specifying it in the config or env.
return { isValid, reasons } | ||
} | ||
|
||
const validateCompletedTimestamp = (payload) => { | ||
const maxLag = (Config.MAX_FULFIL_TIMEOUT_DURATION_SECONDS || defaultLagSeconds) * 1000 |
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.
Would it not be better to have the default values set in the config.js instead of here?
src/lib/config.js
Outdated
@@ -3,6 +3,7 @@ const RC = require('rc')('CLEDG', require('../../config/default.json')) | |||
module.exports = { | |||
HOSTNAME: RC.HOSTNAME.replace(/\/$/, ''), | |||
PORT: RC.PORT, | |||
MAX_FULFIL_TIMEOUT_DURATION_SECONDS: RC.MAX_FULFIL_TIMEOUT_DURATION_SECONDS, |
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.
I.e. I feel that it would be better to have the default value set here.
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. It's better. done.
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, but minor comment for you to address.
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.
+1
feat(mojaloop/#2801): add fulfil timestamp validation and more error handling - mojaloop/project#2801
bulk-api-adapter