Skip to content

Commit

Permalink
perf: Do not index attachments after plugin has loaded (#2465)
Browse files Browse the repository at this point in the history
Fixes #2464

Non-markdown files that were added, renamed or deleted after the plugin had loaded
were being passed to Cache.indexFile() which was then reading them.

This could cause wasted work, and when deleting non-markdown files,
would trigger Tasks search results to be needlessly redrawn.
  • Loading branch information
claremacrae authored Dec 1, 2023
1 parent a9b695e commit bface59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ export class Cache {
}

if (!file.path.endsWith('.md')) {
this.logger.warn('indexFile: WARNING: indexing non-markdown file: ' + file.path);
this.logger.debug('indexFile: skipping non-markdown file: ' + file.path);
return;
}

this.logger.debug('Cache.indexFile: ' + file.path);
Expand Down

0 comments on commit bface59

Please sign in to comment.