diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-08 20:18:12 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-09 10:36:09 -0400 |
commit | ab66a19a3f9368723dfe569d4d31c6b2b9e6656c (patch) | |
tree | e80147af61b38e7fea7ab0304772d5ccd405658c /server/responder/nss/nsssrv.c | |
parent | dcc9605bc490aaf4872dc98c3b81829f9943556e (diff) | |
download | sssd-ab66a19a3f9368723dfe569d4d31c6b2b9e6656c.tar.gz sssd-ab66a19a3f9368723dfe569d4d31c6b2b9e6656c.tar.xz sssd-ab66a19a3f9368723dfe569d4d31c6b2b9e6656c.zip |
Add support for the EntryCacheNoWaitRefreshTimeout
This timeout specifies the lifetime of a cache entry before it is
updated out-of-band. When this timeout is hit, the request will
still complete from cache, but the SSSD will also go and update
the cached entry in the background to extend the life of the
cache entry and reduce the wait time of a future request.
Diffstat (limited to 'server/responder/nss/nsssrv.c')
-rw-r--r-- | server/responder/nss/nsssrv.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c index ad8043890..3920189af 100644 --- a/server/responder/nss/nsssrv.c +++ b/server/responder/nss/nsssrv.c @@ -107,6 +107,22 @@ static int nss_get_config(struct nss_ctx *nctx, &nctx->filter_users_in_groups); if (ret != EOK) goto done; + + ret = confdb_get_int(cdb, nctx, NSS_SRV_CONFIG, + "EntryCacheNoWaitRefreshTimeout", 0, + &nctx->cache_refresh_timeout); + if (ret != EOK) goto done; + if (nctx->cache_refresh_timeout >= nctx->cache_timeout) { + DEBUG(0,("Configuration error: EntryCacheNoWaitRefreshTimeout exceeds" + "EntryCacheTimeout. Disabling feature.\n")); + nctx->cache_refresh_timeout = 0; + } + if (nctx->cache_refresh_timeout < 0) { + DEBUG(0,("Configuration error: EntryCacheNoWaitRefreshTimeout is" + "invalid. Disabling feature.\n")); + nctx->cache_refresh_timeout = 0; + } + ret = confdb_get_string_as_list(cdb, tmpctx, NSS_SRV_CONFIG, "filterUsers", &filter_list); if (ret == ENOENT) filter_list = NULL; |