Skip to content

Commit

Permalink
Optimize of multi-db write
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed May 9, 2024
1 parent ca701b0 commit 9738345
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/src/clixon_datastore_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,8 @@ xmldb_multi_write_applyfn(cxobj *x,
if (clixon_xml2file1(fsub, x, 0, mw->mw_pretty, NULL, fprintf, 1, 0, mw->mw_wdef, 0) < 0)
goto done;
}
retval = 2; /* Locally abort */
goto done;
}
}
retval = 0;
Expand Down Expand Up @@ -1482,11 +1484,8 @@ xmldb_dump(clixon_handle h,
if ((xm = clicon_modst_cache_get(h, 1)) != NULL){
if ((xmodst = xml_dup(xm)) == NULL)
goto done;
/* There are two views on where to insert modstate in config: first or last
* Request from user for last
*/
#if 1
/* This is inserted last in config */
/* This is inserted last in config, seems preferred */
if (xml_addsub(xt, xmodst) < 0)
goto done;
#else
Expand Down Expand Up @@ -1531,7 +1530,6 @@ xmldb_dump(clixon_handle h,
return retval;
}


/*! Given datastore, get cache and format, set wdef, add modstate and print to multiple files
*
* Also add mod-state if applicable
Expand Down
6 changes: 5 additions & 1 deletion yang/clixon/clixon-config@2024-04-01.yang
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,11 @@ module clixon-config {
type string;
mandatory true;
description
"Directory where \"running\", \"candidate\" and \"startup\" are placed.";
"Directory where datastores such as \"running\", \"candidate\" and \"startup\"
are placed.
If CLICON_XMLDB_MULTI is enabled, this is the directory where a datastore
subdir is stored, such as \"running.d/\"
";
}

leaf CLICON_DATASTORE_CACHE {
Expand Down

0 comments on commit 9738345

Please sign in to comment.