I have a default set of templates in a folder structure, that I want duplicated for each new user.
I'm currently creating a new folder and then using the /studio/hierarchyMove
endpoint to "clone" from the source folder into the new folder, e.g.
// Do the clone - from the existing folder to the newly created folder
const cloneUrl = `${jsReportSettings.url}/studio/hierarchyMove`;
const clonePayload = {
source: {
id: jsReportSettings.cloneFolderId,
entitySet: "folders",
onlyChildren: true,
},
target: {
shortid: newFolderResult.shortid,
updateReferences: true,
},
copy: true,
replace: false,
};
(Not sure if there's a better approach, I got the above from examining the network calls when cloning a folder in the Studio...)
This does work, but I have an issue where the cloning process as outlined above is taking longer and longer with each new user.
Any ideas? Is there a better way to "clone" a folder? I couldn't find any documentation on the /studio/hierarchyMove
endpoint, so not sure what the parameters do and if there's an option there that might help - updateReferences
maybe?
Also, I'm currently using the file system - default jsreport-fs-store
- for this (running a Docker image on Azure Container Apps with a "Premium" performance storage account - SSD backed).
Would switching to using a database backed store be faster, e.g. MongoDB or Postgres? Are there any benchmarks around what's fastest?