X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0821f5481edd016a3744bb50d97a9e5b99cd1a0f..HEAD:/services/api/lib/tasks/delete_old_container_logs.rake diff --git a/services/api/lib/tasks/delete_old_container_logs.rake b/services/api/lib/tasks/delete_old_container_logs.rake index 3421fb8b96..db1b3667cc 100644 --- a/services/api/lib/tasks/delete_old_container_logs.rake +++ b/services/api/lib/tasks/delete_old_container_logs.rake @@ -1,14 +1,16 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + # This task finds containers that have been finished for at least as long as # the duration specified in the `clean_container_log_rows_after` config setting, # and deletes their stdout, stderr, arv-mount, crunch-run, and crunchstat logs # from the logs table. namespace :db do - desc "Remove old container log entries from the logs table" + desc "deprecated / no-op" task delete_old_container_logs: :environment do - delete_sql = "DELETE FROM logs WHERE id in (SELECT logs.id FROM logs JOIN containers ON logs.object_uuid = containers.uuid WHERE event_type IN ('stdout', 'stderr', 'arv-mount', 'crunch-run', 'crunchstat') AND containers.log IS NOT NULL AND containers.finished_at < '#{Rails.configuration.clean_container_log_rows_after.ago}')" - - ActiveRecord::Base.connection.execute(delete_sql) + Rails.logger.info "this db:delete_old_container_logs rake task is no longer used" end end