Merge branch '8784-dir-listings'
[arvados.git] / services / api / lib / sweep_trashed_collections.rb
index ab2d27af31b84a2ddb3ad1ed0528eda61cc5632a..84497a179dc06e24792a196cc053261eeaa31786 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 require 'current_api_client'
 
 module SweepTrashedCollections
@@ -23,8 +27,11 @@ module SweepTrashedCollections
     end
     if need
       Thread.new do
+        Thread.current.abort_on_exception = false
         begin
           sweep_now
+        rescue => e
+          Rails.logger.error "#{e.class}: #{e}\n#{e.backtrace.join("\n\t")}"
         ensure
           ActiveRecord::Base.connection.close
         end