feat: added --disable-size flag and related handling#246
feat: added --disable-size flag and related handling#246yetanotheraryan wants to merge 2 commits intovoidcosmos:mainfrom
Conversation
|
Thanks for opening this PR! I've been reviewing it and found a bug: when The fix should keep calling |
| if (this.config.disableSize) { | ||
| this.scanSubscription = scan$.subscribe({ | ||
| next: () => this.printFoldersSection(), | ||
| error: (error) => this.newError(error), | ||
| complete: () => this.completeSearch(), | ||
| }); | ||
| } else { | ||
| this.scanSubscription = scan$ | ||
| .pipe( | ||
| mergeMap( | ||
| (nodeFolder) => this.scanService.calculateFolderStats(nodeFolder), | ||
| 10, // Limit to 10 concurrent stat calculations at a time | ||
| ), | ||
| tap((folder) => this.processFolderStatsForUi(folder)), | ||
| ) | ||
| .subscribe({ | ||
| next: () => this.printFoldersSection(), | ||
| error: (error) => this.newError(error), | ||
| complete: () => this.completeSearch(), | ||
| }); | ||
| } |
There was a problem hiding this comment.
Instead of branching here, keep callng calculateFolderStats always. Move the disableSize check inside that emthod so it skips only the size calculation but still computes modificationTime.
There was a problem hiding this comment.
@zaldih Alright, thanks for the review, I have done the required changes, now the age section works as expected, verified the same as well.
For #240
Changes
disableSizeto the CLI config interface and default config.--disable-sizeoption in CLI help/options.ResultsUiso result rendering can react todisableSize.calculateFolderStats()whendisableSizeis enabled.--delete-allhandling so folders can be deleted as soon as they are found when size calculation is disabled.disableSizefield.Validation
npm run buildpasses.npm testpasses.node lib/index.js --helpshows--disable-size.Note
--disable-sizecurrently affects interactive UI mode.