Skip to content

Commit

Permalink
Avoid long-running REQ commands by setting a statement_timeout on pg …
Browse files Browse the repository at this point in the history
…side
  • Loading branch information
viktorvsk committed Nov 22, 2023
1 parent d2b7e77 commit 1f38ae9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/jobs/new_subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ def perform(connection_id, subscription_id, filters)

MemStore.fanout(cid: connection_id, sid: subscription_id, command: :found_end, payload: "EOSE")
ReqFiltersLog.create(filters: filters) if SHOULD_LOG_FILTERS
rescue ActiveRecord::QueryCanceled
MemStore.fanout(cid: connection_id, command: :notice, payload: "#{subscription_id} subscription timeout, please try to make a simpler query")
end
end

0 comments on commit 1f38ae9

Please sign in to comment.