diff options
author | Heiko Bernloehr <freeit@nflexpvipecs.rus.uni-stuttgart.de> | 2016-01-11 15:25:55 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2016-02-12 05:56:25 +0100 |
commit | 2d2a1d7b95c0c4806e1b987cdeaf5eda1f849048 (patch) | |
tree | a2e11d6522f27d4973b95499dc15fa01055e1586 | |
parent | a6078f386f4260babb79bc5c88f25ed4fab99497 (diff) | |
download | ecs2-2d2a1d7b95c0c4806e1b987cdeaf5eda1f849048.tar.gz ecs2-2d2a1d7b95c0c4806e1b987cdeaf5eda1f849048.zip |
Change ECS garbage collections.
-rw-r--r-- | lib/tasks/ecs_garbage_collect_anonymous_participants.rake | 2 | ||||
-rw-r--r-- | 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 |