From 816fb71b8a5433becf6c68138a830bbc5e961d37 Mon Sep 17 00:00:00 2001 From: Heiko Bernloehr Date: Mon, 11 Jan 2016 15:25:55 +0100 Subject: Change ECS garbage collections. --- lib/tasks/ecs_garbage_collect_anonymous_participants.rake | 2 +- lib/tasks/ecs_garbage_collect_sub_participants.rake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/ecs_garbage_collect_anonymous_participants.rake b/lib/tasks/ecs_garbage_collect_anonymous_participants.rake index f0c4836..50d894a 100644 --- a/lib/tasks/ecs_garbage_collect_anonymous_participants.rake +++ b/lib/tasks/ecs_garbage_collect_anonymous_participants.rake @@ -3,7 +3,7 @@ namespace :ecs do task :gc_anonymous_participants => :environment do num= Participant.find(:all, :conditions => ["(anonymous = ?) AND (ttl < ?)", true, DateTime.now.utc]).length Participant.destroy_all(["(anonymous = ?) AND (ttl < ?)", true, DateTime.now.utc]) - txt= "Number of deleted messages: #{num}" + txt= "gc_anonymous_participants: Number of deleted outtimed anonymous participants: #{num}" puts txt RAILS_DEFAULT_LOGGER.info txt end diff --git a/lib/tasks/ecs_garbage_collect_sub_participants.rake b/lib/tasks/ecs_garbage_collect_sub_participants.rake index eba5971..b20c50b 100644 --- a/lib/tasks/ecs_garbage_collect_sub_participants.rake +++ b/lib/tasks/ecs_garbage_collect_sub_participants.rake @@ -1,7 +1,7 @@ namespace :ecs do desc "Delete outtimed subparticipants." task :gc_sub_participants => :environment do - ttl= 10.days.ago + ttl= 2.days.ago num= 0 Participant.only_subparticipants.each do |p| if p.created_at <= ttl @@ -9,7 +9,7 @@ namespace :ecs do num+=1 end end - txt= "Number of deleted subparticipants: #{num}" + txt= "gc_sub_participants: Number of deleted subparticipants: #{num}" puts txt RAILS_DEFAULT_LOGGER.info txt end -- cgit v1.2.3