Merge pull request #4424 from sbwalker/dev

use Task.FromResult()
This commit is contained in:
Shaun Walker 2024-07-17 16:22:16 -04:00 committed by GitHub
commit a8662bdb8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 10 deletions

View File

@ -1,6 +1,5 @@
using Oqtane.Models; using Oqtane.Models;
using Oqtane.Repository; using Oqtane.Repository;
using Oqtane.Documentation;
using Oqtane.Interfaces; using Oqtane.Interfaces;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
@ -22,10 +21,8 @@ namespace Oqtane.Modules.Admin.Files.Manager
_fileRepository = fileRepository; _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 searchContents = new List<SearchContent>();
var folders = _folderRepository.GetFolders(pageModule.Module.SiteId); var folders = _folderRepository.GetFolders(pageModule.Module.SiteId);
@ -72,11 +69,10 @@ namespace Oqtane.Modules.Admin.Files.Manager
}; };
searchContents.Add(searchContent); searchContents.Add(searchContent);
} }
} }
} }
return searchContents; return Task.FromResult(searchContents);
} }
} }
} }

View File

@ -49,10 +49,8 @@ namespace Oqtane.Modules.HtmlText.Manager
return content; 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 searchContents = new List<SearchContent>();
var htmltexts = _htmlText.GetHtmlTexts(pageModule.ModuleId); var htmltexts = _htmlText.GetHtmlTexts(pageModule.ModuleId);
@ -72,7 +70,7 @@ namespace Oqtane.Modules.HtmlText.Manager
} }
} }
return searchContents; return Task.FromResult(searchContents);
} }
public void ImportModule(Module module, string content, string version) public void ImportModule(Module module, string content, string version)