Merge branch '14259-pysdk-remote-block-copy'
[arvados.git] / services / api / lib / sweep_trashed_objects.rb
index 59008c0fc38067a3bf3ece9a885c0bfebfa2a438..bedbd68a44c8a9e988c202a21457281f680e840a 100644 (file)
@@ -48,6 +48,9 @@ module SweepTrashedObjects
         where({group_class: 'project'}).
         where('is_trashed = false and trash_at < statement_timestamp()').
         update_all('is_trashed = true')
+
+      # Sweep expired tokens
+      ActiveRecord::Base.connection.execute("DELETE from api_client_authorizations where expires_at <= statement_timestamp()")
     end
   end