-
Notifications
You must be signed in to change notification settings - Fork 38
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: remove link statistics and ga served events #243
Conversation
LinkStatisticsRepository updates click stats by finding the instance, then incrementing. This may result in larger transactions than needed, given that the increment can be done in a single statement. Rework the implementation so that we update, and if not present, we insert. We will also do this in many small transactions. Attempts to implement using `Model.upsert()` were not successful, due to Sequelize creating temporary functions which fail to reference the target table. - interface - rework jsdoc, change return type to boolean - impl - use `Model.update()` and `Sequelize.literal`, if not found, `Model.insert()` or throw not found error - Drop the constraint of doing stats updates in a single txn
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. I'm unsure whether removing userAgent
would be appropriate given that we are probably adding it back later on, but you don't have to make the change now.
|
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
Co-authored-by: Yuan Ruo <liangyuanruo@gmail.com>
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 👍
Problem
Solution