diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2018-02-28 22:21:39 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2018-03-20 13:41:54 +0100 |
commit | e72cf3382bb7834ea95ddc44c5b9616150973f4c (patch) | |
tree | 6db5a83b5bacb04619e4cf81d8dfd08596ca2213 /config | |
parent | 674c47bc2cedf71f7f52ce07052fed8c0c3578d6 (diff) | |
download | ecs-e72cf3382bb7834ea95ddc44c5b9616150973f4c.tar.gz ecs-e72cf3382bb7834ea95ddc44c5b9616150973f4c.zip |
Add garbage collecting tasks.
New environment variables:
ECS_PARTICIPANTS_TTL_SUB: Number of days created before garbage collected
ECS_PARTICIPANTS_TTL_ANONYMOUS: Number of days created before garbage collected
Diffstat (limited to 'config')
-rw-r--r-- | config/ecs_config.yml | 2 | ||||
-rw-r--r-- | config/initializers/ecs_00.rb | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/config/ecs_config.yml b/config/ecs_config.yml index 77cebb0..aa4834e 100644 --- a/config/ecs_config.yml +++ b/config/ecs_config.yml @@ -1,5 +1,7 @@ participants: allow_anonymous: false + ttl_anonymous: 1 # number of days created before garbage collected + ttl_sub: 1 # number of days created before garbage collected allow_events: true # for database migration admin: confirm_actions: false diff --git a/config/initializers/ecs_00.rb b/config/initializers/ecs_00.rb index fa7a179..6869046 100644 --- a/config/initializers/ecs_00.rb +++ b/config/initializers/ecs_00.rb @@ -1,17 +1,17 @@ -# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# Copyright (C) 2007, 2008, 2009, 2010, 2018 Heiko Bernloehr (FreeIT.de). +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. @@ -38,3 +38,5 @@ end ECS_CONFIG["participants"]["allow_anonymous"] ||= false ECS_CONFIG["participants"]["allow_events"] ||= true ECS_CONFIG["admin"]["confirm_actions"] ||= true +ECS_CONFIG["participants"]["ttl_sub"] = ENV["ECS_PARTICIPANTS_TTL_SUB"] || ECS_CONFIG["participants"]["ttl_sub"] || 1 +ECS_CONFIG["participants"]["ttl_anonymous"] = ENV["ECS_PARTICIPANTS_TTL_ANONYMOUS"] || ECS_CONFIG["participants"]["ttl_anonymous"] || 1 |