Skip to content
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

Move network calls out of transaction in ActivityPub handler #8951

Merged
merged 1 commit into from Oct 10, 2018

Conversation

@Gargron
Copy link
Member

commented Oct 10, 2018

Mention and emoji code may perform network calls, but does not need
to do that inside the database transaction. This may improve availability
of database connections when using pgBouncer in transaction mode.

@Gargron Gargron added the performance label Oct 10, 2018
end

def process_tags(status)
@params = begin

This comment has been minimized.

Copy link
@nightpool

nightpool Oct 10, 2018

Collaborator

why begin here? shouldn't this just be @params = { ?

This comment has been minimized.

Copy link
@Gargron

Gargron Oct 10, 2018

Author Member

Otherwise rubocop will require me to align the hash with the = which sucks. begin/end does nothing except improve the formatting.

This comment has been minimized.

Copy link
@nightpool

nightpool Oct 10, 2018

Collaborator

which rule was it? Layout/AlignHash definitely doesn't work that way. We should make sure to change the rubocop lint formatting when we run into a situation where it's behaving badly, so that we're consistent across PRs

This comment has been minimized.

Copy link
@Gargron

Gargron Oct 10, 2018

Author Member

As far as I am aware we are required to:

  hash = {
           foo: bar,
           baz: boo,
         }

Which looks bad.

This comment has been minimized.

Copy link
@nightpool

nightpool Oct 10, 2018

Collaborator

My understanding is that the default Layout/AlignHash and Layout/IndentHash rule should pass with this code:

hash = {
  foo: bar,
  baz: boo,
}
@nightpool

This comment has been minimized.

Copy link
Collaborator

commented Oct 10, 2018

approve modulo formatting nits

Mention and emoji code may perform network calls, but does not need
to do that inside the database transaction. This may improve availability
of database connections when using pgBouncer in transaction mode.
@Gargron Gargron force-pushed the fix-network-in-transaction branch from 542154a to 16a884c Oct 10, 2018
@Gargron Gargron merged commit 790d3bc into master Oct 10, 2018
11 checks passed
11 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: check-i18n Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-webui Your tests passed on CircleCI!
Details
codeclimate All good!
Details
@Gargron Gargron deleted the fix-network-in-transaction branch Oct 10, 2018
Gargron added a commit that referenced this pull request Oct 11, 2018
Regression from #8951
Gargron added a commit that referenced this pull request Oct 11, 2018
Regression from #8951
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.