diff options
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/data_provider_be.c | 23 | ||||
-rw-r--r-- | src/providers/dp_backend.h | 3 | ||||
-rw-r--r-- | src/providers/dp_ptask.h | 3 | ||||
-rw-r--r-- | src/providers/dp_refresh.h | 3 |
4 files changed, 32 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index f3b50af7..1e11bfd2 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -42,6 +42,8 @@ #include "sbus/sssd_dbus.h" #include "providers/dp_backend.h" #include "providers/fail_over.h" +#include "providers/dp_refresh.h" +#include "providers/dp_ptask.h" #include "util/child_common.h" #include "resolv/async_resolv.h" #include "monitor/monitor_interfaces.h" @@ -2657,6 +2659,27 @@ int be_process_init(TALLOC_CTX *mem_ctx, goto fail; } + /* Initialize be_refresh periodic task. */ + ctx->refresh_ctx = be_refresh_ctx_init(ctx); + if (ctx->refresh_ctx == NULL) { + DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to initialize refresh_ctx\n")); + ret = ENOMEM; + goto fail; + } + + if (ctx->domain->refresh_expired_interval > 0) { + ret = be_ptask_create(ctx, ctx, ctx->domain->refresh_expired_interval, + 30, 5, ctx->domain->refresh_expired_interval, + BE_PTASK_OFFLINE_SKIP, + be_refresh_send, be_refresh_recv, + ctx->refresh_ctx, "Refresh Records", NULL); + if (ret != EOK) { + DEBUG(SSSDBG_FATAL_FAILURE, + ("Unable to initialize refresh periodic task\n")); + goto fail; + } + } + ret = load_backend_module(ctx, BET_ID, &ctx->bet_info[BET_ID], NULL); if (ret != EOK) { diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index 9a8df4cd..638b878c 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -24,6 +24,7 @@ #include "providers/data_provider.h" #include "providers/fail_over.h" +#include "providers/dp_refresh.h" #include "util/child_common.h" #include "db/sysdb.h" @@ -141,6 +142,8 @@ struct be_ctx { struct loaded_be loaded_be[BET_MAX]; struct bet_info bet_info[BET_MAX]; + struct be_refresh_ctx *refresh_ctx; + size_t check_online_ref_count; }; diff --git a/src/providers/dp_ptask.h b/src/providers/dp_ptask.h index 5a1d62c8..ae5f78d5 100644 --- a/src/providers/dp_ptask.h +++ b/src/providers/dp_ptask.h @@ -27,6 +27,9 @@ #include "providers/dp_backend.h" +/* solve circular dependency */ +struct be_ctx; + struct be_ptask; /** diff --git a/src/providers/dp_refresh.h b/src/providers/dp_refresh.h index cae2f787..a7b32470 100644 --- a/src/providers/dp_refresh.h +++ b/src/providers/dp_refresh.h @@ -27,6 +27,9 @@ #include "providers/dp_backend.h" #include "providers/dp_ptask.h" +/* solve circular dependency */ +struct be_ctx; + /** * name_list contains SYSDB_NAME of all expired records. */ |