From a0f6a6a27ec94d1f9ad31bdaa05f50ba407a9212 Mon Sep 17 00:00:00 2001 From: Heiko Bernloehr Date: Thu, 9 Aug 2018 10:18:43 +0200 Subject: Fix ttl garbage collection time compare. --- lib/tasks/ecs_garbage_collect_anonymous_participants.rake | 2 +- lib/tasks/ecs_garbage_collect_sub_participants.rake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/ecs_garbage_collect_anonymous_participants.rake b/lib/tasks/ecs_garbage_collect_anonymous_participants.rake index 8c87cac..ee0f5e4 100644 --- a/lib/tasks/ecs_garbage_collect_anonymous_participants.rake +++ b/lib/tasks/ecs_garbage_collect_anonymous_participants.rake @@ -22,7 +22,7 @@ namespace :ecs do ttl= ECS_CONFIG["participants"]["ttl_anonymous"] num= 0 Participant.only_anonymous.each do |p| - if p.created_at <= ttl + if p.created_at <= ttl.days.ago p.destroy num+=1 end diff --git a/lib/tasks/ecs_garbage_collect_sub_participants.rake b/lib/tasks/ecs_garbage_collect_sub_participants.rake index 046e36e..0067816 100644 --- a/lib/tasks/ecs_garbage_collect_sub_participants.rake +++ b/lib/tasks/ecs_garbage_collect_sub_participants.rake @@ -22,7 +22,7 @@ namespace :ecs do ttl= ECS_CONFIG["participants"]["ttl_sub"] num= 0 Participant.only_subparticipants.each do |p| - if p.created_at <= ttl + if p.created_at <= ttl.days.ago p.destroy num+=1 end -- cgit v1.2.3