Skip to content

Commit

Permalink
add transaction example
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Aug 14, 2024
1 parent 9d2d3e4 commit 40bce10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ User.posts.statement_timeout 10.seconds do
some_cheap_operation
end

Post.statement_timeout 10.minutes do |conn|
conn.transaction { archive_old_posts }
end

Tag.statement_timeout 6.hours do |conn|
conn.execute 'VACUUM ANALYZE tags'
end
Expand Down

0 comments on commit 40bce10

Please sign in to comment.