-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comments: fewer db round trips on creation
Writes a vote directly to avoid vote_thusly doing round trips to check if one exists, etc. Removes redundant transactions from controllers from #899. Rails already creates a transaction for the .save. Unifies Story cache updating. Previously recalculate_hotness! was called twice on comment creation. Moves comment counting into the db. Shorter transaction should reduce the frequence of lobsters/lobsters-ansible/issues/39 but seems unlikely to eliminate it as the create + upvote transactions for stories + comments still read/write from stories, comments, and votes.
- Loading branch information
Showing
5 changed files
with
19 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters