summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/data_provider_be.c23
-rw-r--r--src/providers/dp_backend.h3
-rw-r--r--src/providers/dp_ptask.h3
-rw-r--r--src/providers/dp_refresh.h3
4 files changed, 32 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 33590aeef..3354695cf 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"
@@ -2494,6 +2496,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 743b6f4ff..a2af785ca 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"
@@ -123,6 +124,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 3e0fd2dde..2a0288de4 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 9b152acb8..e93034096 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.
*/