-
Notifications
You must be signed in to change notification settings - Fork 8
[PROD] - Jan 26 r1 #188
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
base: master
Are you sure you want to change the base?
[PROD] - Jan 26 r1 #188
Conversation
…k, and MM only once, to avoid duplicate processing
| @@ -0,0 +1,2 @@ | |||
| -- Add eventRaised flag to submission to prevent duplicate event publishing | |||
| ALTER TABLE "submission" ADD COLUMN "eventRaised" BOOLEAN NOT NULL DEFAULT false; | |||
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.
[performance]
Consider adding an index on the eventRaised column if this column will be frequently queried for filtering purposes. This can improve query performance.
| private async publishFirst2FinishEvent( | ||
| submission: SubmissionRecord, | ||
| ): Promise<void> { | ||
| if (submission.eventRaised) { |
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.
[maintainability]
The check for submission.eventRaised is duplicated across multiple methods (publishFirst2FinishEvent, publishTopgearTaskEvent, publishMarathonMatchEvent). Consider refactoring this logic into a separate method to improve maintainability and reduce code duplication.
| return (typeName ?? '').trim().toLowerCase() === 'marathon match'; | ||
| } | ||
|
|
||
| private async markEventRaised( |
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.
[correctness]
The markEventRaised method updates the eventRaised flag in the database. Ensure that this operation is idempotent and that the database state is consistent even if this method is called multiple times for the same submission. Consider adding a check to see if the flag is already set before attempting an update.
|
@jmgasper can you check if this is ready for promote and if yes deploy it? |
…k, and MM only once, to avoid duplicate processing