Merge branch '12287-preserve-json-numbers' closes #12287
[arvados.git] / services / api / lib / refresh_permission_view.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 PERMISSION_VIEW = "materialized_permission_view"
6
7 def refresh_permission_view
8   ActiveRecord::Base.transaction do
9     ActiveRecord::Base.connection.execute("LOCK TABLE permission_refresh_lock")
10     ActiveRecord::Base.connection.execute("REFRESH MATERIALIZED VIEW #{PERMISSION_VIEW}")
11   end
12 end