Merge branch '16387-batch-update-deactivated-user'
[arvados.git] / services / api / lib / refresh_permission_view.rb
index f3e1ed6a4575e44c78d707e55610e7f8a384b9ba..5d6081f262b25756dd7e3fcdeec42ae762c4687f 100644 (file)
@@ -12,9 +12,13 @@ def do_refresh_permission_view
 end
 
 def refresh_permission_view(async=false)
-  if async and Rails.configuration.async_permissions_update_interval > 0
-    exp = Rails.configuration.async_permissions_update_interval.seconds
+  if async and Rails.configuration.API.AsyncPermissionsUpdateInterval > 0
+    exp = Rails.configuration.API.AsyncPermissionsUpdateInterval.seconds
+    need = false
     Rails.cache.fetch('AsyncRefreshPermissionView', expires_in: exp) do
+      need = true
+    end
+    if need
       # Schedule a new permission update and return immediately
       Thread.new do
         Thread.current.abort_on_exception = false