Optimize of multi-db write

This commit is contained in:
Olof hagsand 2024-05-09 12:18:35 +02:00
parent ca701b0c1a
commit 9738345f82
2 changed files with 8 additions and 6 deletions

View file

@ -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;
@ -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
@ -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

View file

@ -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 {