Skip to content

Commit

Permalink
opdocs from cache for coreops when asking for namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
steam0r committed Jun 27, 2024
1 parent 81baaf5 commit 63663c5
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions shared/api/utils/shared_doc_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,21 @@ export default class SharedDocUtil extends SharedUtil
let opDocs = [];
if (!collectionName) return opDocs;
collectionName = this._opsUtil.getCollectionName(collectionName);
const dirName = this._opsUtil.getCollectionOpDocFile(collectionName);
if (fs.existsSync(dirName))
if (this._opsUtil.isCoreOp(collectionName))
{
const opNames = this._opsUtil.getCollectionOpNames(collectionName);
opDocs = this._opsUtil.addOpDocsForCollections(opNames, opDocs);
opDocs = this._opsUtil.addVersionInfoToOps(opDocs);
opDocs = this._opsUtil.addPermissionsToOps(opDocs, currentUser);
opDocs = this.getOpDocs().filter((opDoc) => { return opDoc.name.startsWith(collectionName); });
}
else
{
const dirName = this._opsUtil.getCollectionOpDocFile(collectionName);
if (fs.existsSync(dirName))
{
const opNames = this._opsUtil.getCollectionOpNames(collectionName);
opDocs = this._opsUtil.addOpDocsForCollections(opNames, opDocs);
}
}
opDocs = this._opsUtil.addVersionInfoToOps(opDocs);
opDocs = this._opsUtil.addPermissionsToOps(opDocs, currentUser);
return opDocs;
}

Expand Down

0 comments on commit 63663c5

Please sign in to comment.