flexrep.pushLocalForest( domain-id as (Number|String), forest-id as (Number|String), max-spawn as (Number|String) ) as null
This function pushes pending replication updates (either retries or zero-day) for the specified forest on the current host. If any updates are found, a new task is spawned to call this function again. This continues until all pending replication updates have been processed.
const flexrep = require('/MarkLogic/flexrep'); const admin = require('/MarkLogic/admin'); const domain = xdmp.eval( 'const dom = require("/MarkLogic/cpf/domains");' + 'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));', null, { 'database' : xdmp.database('Triggers') }); const cfg = flexrep.configurationGet(domain, true); const domainId = flexrep.configurationGetId(cfg); const forestId = admin.forestGetId(admin.getConfiguration(), "Master-forest"); flexrep.pushLocalForest(domainId, forestId, 10); // Pushes all pending replication updates from the "Master-forest" forest on the host.
http://marklogic.com/xdmp/privileges/flexrep-user