Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use Task.FromResult() #4424

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Oqtane.Server/Modules/Admin/Files/Manager/FileManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Oqtane.Models;
using Oqtane.Repository;
using Oqtane.Documentation;
using Oqtane.Interfaces;
using System.Collections.Generic;
using System;
Expand All @@ -22,10 +21,8 @@ public FileManager(IFolderRepository folderRepository, IFileRepository fileRepos
_fileRepository = fileRepository;
}

public async Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn)
public Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn)
{
await Task.CompletedTask;

var searchContents = new List<SearchContent>();

var folders = _folderRepository.GetFolders(pageModule.Module.SiteId);
Expand Down Expand Up @@ -72,11 +69,10 @@ public async Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageMod
};
searchContents.Add(searchContent);
}

}
}

return searchContents;
return Task.FromResult(searchContents);
}
}
}
6 changes: 2 additions & 4 deletions Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ public string ExportModule(Module module)
return content;
}

public async Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn)
public Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageModule, DateTime lastIndexedOn)
{
await Task.CompletedTask;

var searchContents = new List<SearchContent>();

var htmltexts = _htmlText.GetHtmlTexts(pageModule.ModuleId);
Expand All @@ -72,7 +70,7 @@ public async Task<List<SearchContent>> GetSearchContentsAsync(PageModule pageMod
}
}

return searchContents;
return Task.FromResult(searchContents);
}

public void ImportModule(Module module, string content, string version)
Expand Down