mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Delete the unnecessary sync timer
This commit is contained in:
parent
a332ebef29
commit
3e9faeff2b
2 changed files with 3 additions and 11 deletions
|
|
@ -886,15 +886,11 @@ int bbfdm_print_data_model_schema(struct bbfdm_context *bbfdm_ctx, const enum bb
|
|||
return err;
|
||||
}
|
||||
|
||||
static void perform_uci_sync_op(struct uloop_timeout *timeout)
|
||||
static void perform_uci_sync_op(struct bbfdm_context *bbfdm_ctx)
|
||||
{
|
||||
DM_MAP_OBJ *dynamic_obj = INTERNAL_ROOT_TREE;
|
||||
|
||||
if (dynamic_obj == NULL)
|
||||
return;
|
||||
|
||||
struct bbfdm_context *bbfdm_ctx = container_of(timeout, struct bbfdm_context, sync_timer);
|
||||
if (bbfdm_ctx == NULL)
|
||||
if (dynamic_obj == NULL || bbfdm_ctx == NULL)
|
||||
return;
|
||||
|
||||
for (int i = 0; dynamic_obj[i].path; i++) {
|
||||
|
|
@ -907,7 +903,6 @@ static void perform_uci_sync_op(struct uloop_timeout *timeout)
|
|||
|
||||
if (bbfdm_refresh_references(BBFDM_BOTH, bbfdm_ctx->config.out_name)) {
|
||||
BBF_ERR("Failed to refresh instance data base");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -982,9 +977,7 @@ static void bbfdm_apply_event_cb(struct ubus_context *ctx __attribute__((unused)
|
|||
}
|
||||
|
||||
snprintf(bbfdm_ctx->uci_change_proto, sizeof(bbfdm_ctx->uci_change_proto), "%s", proto);
|
||||
memset(&bbfdm_ctx->sync_timer, 0, sizeof(struct uloop_timeout));
|
||||
bbfdm_ctx->sync_timer.cb = perform_uci_sync_op;
|
||||
uloop_timeout_set(&bbfdm_ctx->sync_timer, 0);
|
||||
perform_uci_sync_op(bbfdm_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ struct bbfdm_context {
|
|||
struct ubus_context *ubus_ctx;
|
||||
struct ubus_object ubus_obj;
|
||||
struct list_head event_handlers;
|
||||
struct uloop_timeout sync_timer;
|
||||
struct list_head changed_uci;
|
||||
bool internal_ubus_ctx;
|
||||
char uci_change_proto[10];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue