summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2018-08-09 10:18:43 +0200
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2018-08-09 10:22:10 +0200
commita0f6a6a27ec94d1f9ad31bdaa05f50ba407a9212 (patch)
treea373c4241b434762bdf93c0d6b765964cf2348d9
parent3cb09a0c39966050cb664666e4769f84848cb1a4 (diff)
downloadecs-a0f6a6a27ec94d1f9ad31bdaa05f50ba407a9212.tar.gz
ecs-a0f6a6a27ec94d1f9ad31bdaa05f50ba407a9212.zip
Fix ttl garbage collection time compare.
-rw-r--r--lib/tasks/ecs_garbage_collect_anonymous_participants.rake2
-rw-r--r--lib/tasks/ecs_garbage_collect_sub_participants.rake2
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