From 6b068dec9ac5b2f22a9c20b5554a6e45af6dc8bb Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 19 Jun 2019 22:03:16 +0200 Subject: [PATCH 37/48] BE: Schedule the refresh interval from the finish time of the last run Related: https://pagure.io/SSSD/sssd/issue/4012 Changes scheduling the periodical task so that the next run is started relative to the previous run finish time, not start time to protect against cases where the refresh would take too long and run practically all the time. Reviewed-by: Sumit Bose --- src/providers/be_refresh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/be_refresh.c b/src/providers/be_refresh.c index 50b023c3d..a9d4295ec 100644 --- a/src/providers/be_refresh.c +++ b/src/providers/be_refresh.c @@ -157,7 +157,7 @@ errno_t be_refresh_ctx_init(struct be_ctx *be_ctx, if (refresh_interval > 0) { ret = be_ptask_create(be_ctx, be_ctx, refresh_interval, 30, 5, 0, refresh_interval, BE_PTASK_OFFLINE_SKIP, - BE_PTASK_SCHEDULE_FROM_LAST, + BE_PTASK_SCHEDULE_FROM_NOW, 0, be_refresh_send, be_refresh_recv, ctx, "Refresh Records", NULL); -- 2.20.1