13593: Moves & enhances group creation with async=true test.
[arvados.git] / services / api / lib / refresh_permission_view.rb
index f3e1ed6a4575e44c78d707e55610e7f8a384b9ba..25be3c08d4d40d8f7dbc7307e76bc7d2423997a6 100644 (file)
@@ -14,7 +14,11 @@ 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
+    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