summaryrefslogtreecommitdiffstats
path: root/src/providers/ipa
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-10-22 14:07:49 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-25 22:18:54 +0200
commit4bee540a09cc9ac986ad6655c3b1fe079189fa0d (patch)
tree876edeb37dc366b1cd234d5ad44e902112ce525f /src/providers/ipa
parent5e9833aa7b1a89cbb2c0cf667a99cb0bc4ad7963 (diff)
downloadsssd-4bee540a09cc9ac986ad6655c3b1fe079189fa0d.tar.gz
sssd-4bee540a09cc9ac986ad6655c3b1fe079189fa0d.tar.xz
sssd-4bee540a09cc9ac986ad6655c3b1fe079189fa0d.zip
dp: make subdomains refresh interval configurable
This patch makes the refresh of available subdomains configurable. New option: subdomain_refresh_interval (undocumented) Resolves: https://fedorahosted.org/sssd/ticket/1968
Diffstat (limited to 'src/providers/ipa')
-rw-r--r--src/providers/ipa/ipa_subdomains.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index d873c5b27..64db70dde 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -47,8 +47,6 @@
/* do not refresh more often than every 5 seconds for now */
#define IPA_SUBDOMAIN_REFRESH_LIMIT 5
-/* refresh automatically every 4 hours */
-#define IPA_SUBDOMAIN_REFRESH_PERIOD (3600 * 4)
#define IPA_SUBDOMAIN_DISABLED_PERIOD 3600
enum ipa_subdomains_req_type {
@@ -1126,6 +1124,7 @@ static void ipa_subdom_online_cb(void *pvt)
struct ipa_subdomains_ctx *ctx;
struct be_req *be_req;
struct timeval tv;
+ uint32_t refresh_interval;
ctx = talloc_get_type(pvt, struct ipa_subdomains_ctx);
if (!ctx) {
@@ -1135,6 +1134,8 @@ static void ipa_subdom_online_cb(void *pvt)
ctx->disabled_until = 0;
+ refresh_interval = ctx->be_ctx->domain->subdomain_refresh_interval;
+
be_req = be_req_create(ctx, NULL, ctx->be_ctx,
ipa_subdom_be_req_callback, NULL);
if (be_req == NULL) {
@@ -1144,7 +1145,7 @@ static void ipa_subdom_online_cb(void *pvt)
ipa_subdomains_retrieve(ctx, be_req);
- tv = tevent_timeval_current_ofs(IPA_SUBDOMAIN_REFRESH_PERIOD, 0);
+ tv = tevent_timeval_current_ofs(refresh_interval, 0);
ctx->timer_event = tevent_add_timer(ctx->be_ctx->ev, ctx, tv,
ipa_subdom_timer_refresh, ctx);
if (!ctx->timer_event) {