mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-15 23:20:32 +03:00
PR#2355 Continued + expanded scope (#2365)
* #2317 Fetch pinned documents once per folder to reduce the number of queries. * Reorder the lines to keeps const declarations together. * Add some comments to functions move pinned document fetch for folder to function move watched documents per-folder to also function the same remove unused function in documents model --------- Co-authored-by: Błażej Owczarczyk <blazeyy@gmail.com>
This commit is contained in:
@@ -38,6 +38,13 @@ const DocumentSyncQueue = {
|
||||
return new Date(Number(new Date()) + queueRecord.staleAfterMs);
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the document can be watched based on the metadata fields
|
||||
* @param {object} metadata - metadata to check
|
||||
* @param {string} metadata.title - title of the document
|
||||
* @param {string} metadata.chunkSource - chunk source of the document
|
||||
* @returns {boolean} - true if the document can be watched, false otherwise
|
||||
*/
|
||||
canWatch: function ({ title, chunkSource = null } = {}) {
|
||||
if (chunkSource.startsWith("link://") && title.endsWith(".html"))
|
||||
return true; // If is web-link material (prior to feature most chunkSources were links://)
|
||||
|
||||
Reference in New Issue
Block a user