-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix: avoid 2 extra db requests #1054
base: feat/fx-impl
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
const cyrilOutput = await this.cyril.processFxFulfilMessage(transfer.commitRequestId, payload) | ||
if (!transfer.fxWatchListId) { | ||
throw new Error(`Commit request ID ${transfer.commitRequestId} not found in watch list`) | ||
} |
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.
Can we still have a function in cyril 'processFxFulfilMessage' for this check? I mean. you can remove the call 'getAllDetailsByCommitRequestId' in that function, but I would recommend the queries (getItemInWatchListByCommitRequestId) on watchlist in the cyril functions instead of having a join in other place. Because the watchlist logic may change and I wouldn't suggest merging watchList in the places other than cyril. I know it's additional query but I hope it will not impact performance that much compared to left join.
@@ -90,9 +90,11 @@ const getAllDetailsByCommitRequestId = async (commitRequestId) => { | |||
.leftJoin('fxTransferStateChange AS tsc', 'tsc.commitRequestId', 'fxTransfer.commitRequestId') | |||
.leftJoin('transferState AS ts', 'ts.transferStateId', 'tsc.transferStateId') | |||
.leftJoin('fxTransferFulfilment AS tf', 'tf.commitRequestId', 'fxTransfer.commitRequestId') | |||
.leftJoin('fxWatchList AS wl', 'wl.commitRequestId', 'fxTransfer.commitRequestId') |
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.
Please see my above comment.
No description provided.