[ARVADOS] updated: 2.1.0-2063-gdc2b31ec8
Git user
git at public.arvados.org
Mon Mar 14 18:29:48 UTC 2022
Summary of changes:
services/api/lib/tasks/delete_old_container_logs.rake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
via dc2b31ec8275995bde3ea855e66bb0137d8a4b62 (commit)
from 601093eb9061c559674721f329fbac6dac2077a2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit dc2b31ec8275995bde3ea855e66bb0137d8a4b62
Author: Ward Vandewege <ward at curii.com>
Date: Mon Mar 14 14:25:08 2022 -0400
Make the sql statement that clears old container logs more efficient by
using now() instead of clock_timestamp(). The former is calculated once
per transaction.
refs #18763
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/services/api/lib/tasks/delete_old_container_logs.rake b/services/api/lib/tasks/delete_old_container_logs.rake
index 2146d9bc3..7a0ab3826 100644
--- a/services/api/lib/tasks/delete_old_container_logs.rake
+++ b/services/api/lib/tasks/delete_old_container_logs.rake
@@ -11,7 +11,7 @@ namespace :db do
desc "Remove old container log entries from the logs table"
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 clock_timestamp() - containers.finished_at > interval '#{Rails.configuration.Containers.Logging.MaxAge.to_i} seconds')"
+ 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 now() - containers.finished_at > interval '#{Rails.configuration.Containers.Logging.MaxAge.to_i} seconds')"
ActiveRecord::Base.connection.execute(delete_sql)
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list