Make zone_purge time threshold configurable.

The default of one week for how old deleted zones
should be purged is too long. This patch makes
it 1 hour by default and adds a new config
option for it (zone-purge-time-threshold).

Change-Id: Ifc6d43ca897c218ae365b4881a2f09b61542efa4
Fixes-Bug: #1899064
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@canonical.com>
This commit is contained in:
Jorge Niedbalski
2020-10-08 15:06:21 -03:00
parent b13d12fc35
commit 1aefb4c274
4 changed files with 13 additions and 2 deletions

View File

@@ -89,3 +89,9 @@ options:
override YAML files in the service's policy.d directory. The resource
file should be a ZIP file containing at least one yaml file with a .yaml
or .yml extension. If False then remove the overrides.
zone-purge-time-threshold:
type: int
default: 3600
description: |
Default for how old deleted zones should be (deleted_at) to be
purged, in seconds.

View File

@@ -232,7 +232,7 @@ enabled_notification_handlers = {{ options.notification_handlers }}
#batch_size = 100
# How old deleted records should be (deleted_at) to be purged, in seconds
#time_threshold = 604800 # 7 days
time_threshold = {{ options.zone_purge_time_threshold }}
#-----------------------
# Pool Manager Service

View File

@@ -235,7 +235,7 @@ enabled_notification_handlers = {{ options.notification_handlers }}
#batch_size = 100
# How old deleted records should be (deleted_at) to be purged, in seconds
#time_threshold = 604800 # 7 days
time_threshold = {{ options.zone_purge_time_threshold }}
#-----------------------
# Pool Manager Service

View File

@@ -323,3 +323,8 @@ backend_url = {{ coordinator_memcached.url }}
# [hook_point:designate.api.v2.controllers.zones.get_one]
{% include "parts/section-oslo-middleware" %}
[producer_task:zone_purge]
# How old deleted records should be (deleted_at) to be purged, in seconds
time_threshold = {{ options.zone_purge_time_threshold }}