*/
static GSource *gAppInfoTimeoutSource = NULL;
-static void TweakGatherLoop(ToolsAppCtx *ctx);
+static void TweakGatherLoop(ToolsAppCtx *ctx, gboolean force);
/*
"information\n", __FUNCTION__);
}
- TweakGatherLoop(ctx);
+ TweakGatherLoop(ctx, TRUE);
return G_SOURCE_REMOVE;
}
* AppInfo Gather loop timeout source.
*
* @param[in] ctx The application context.
+ * @param[in] force If set to TRUE, the poll loop will be
+ * tweaked even if the poll interval hasn't
+ * changed from the previous value.
*
*****************************************************************************
*/
static void
-TweakGatherLoop(ToolsAppCtx *ctx) // IN
+TweakGatherLoop(ToolsAppCtx *ctx, // IN
+ gboolean force) // IN
{
gboolean disabled =
VMTools_ConfigGetBoolean(ctx->config,
}
}
- /*
- * pollInterval can never be a negative value. Typecasting into
- * guint should not be a problem.
- */
- TweakGatherLoopEx(ctx, (guint) pollInterval);
+ if (force || (gAppInfoPollInterval != pollInterval)) {
+ /*
+ * pollInterval can never be a negative value. Typecasting into
+ * guint should not be a problem.
+ */
+ TweakGatherLoopEx(ctx, (guint) pollInterval);
+ }
}
{
g_info("%s: Reloading the tools configuration.\n", __FUNCTION__);
- TweakGatherLoop(ctx);
+ TweakGatherLoop(ctx, FALSE);
}
/*
* Set up the AppInfo gather loop.
*/
- TweakGatherLoop(ctx);
+ TweakGatherLoop(ctx, TRUE);
return ®Data;
}