Skip to content

Commit

Permalink
Merge pull request #573 from TomoyukiAota/feature/loading-folder-logging
Browse files Browse the repository at this point in the history
Fix logging not to log "Loaded 0 files out of 0 files." which happens when the application is still collecting files to load from the opened folder and has not started loading files yet.
  • Loading branch information
mergify[bot] authored Dec 3, 2024
2 parents d6bd864 + 863f20a commit 99e1a5d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class LoadingFolderProgressReporterService {
public progressStatus = new Subject<LoadingFolderProgressStatus>();

public startUpdatingProgress(): void {
Logger.info('[Loading Folder] Collecting files to load from the opened folder...');
const updateMilliseconds = 100;
const intervalId = setInterval(() => {
const numberOfLoadedFiles = progress.numberOfLoadedFiles;
Expand All @@ -27,7 +28,11 @@ export class LoadingFolderProgressReporterService {
const isStarted = progress.isStarted;
const isInProgress = progress.isInProgress;
const isCompleted = progress.isCompleted;
Logger.info(`[Loading Folder] Loaded ${numberOfLoadedFiles} files out of ${numberOfAllFilesToLoad} files.`);

if (isStarted) {
Logger.info(`[Loading Folder] Loaded ${numberOfLoadedFiles} files out of ${numberOfAllFilesToLoad} files.`);
}

this.progressStatus.next({
numberOfLoadedFiles,
numberOfAllFilesToLoad,
Expand Down

0 comments on commit 99e1a5d

Please sign in to comment.