Skip to content

Commit 8cfd80b

Browse files
committed
delay the create query helper call
to catch exception when Windows Search service is not running
1 parent 309ee29 commit 8cfd80b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private async Task<List<Result>> WindowsIndexFileContentSearchAsync(Query query,
143143

144144
return await IndexSearch.WindowsIndexSearchAsync(
145145
querySearchString,
146-
queryConstructor.CreateQueryHelper(),
146+
queryConstructor.CreateQueryHelper,
147147
queryConstructor.QueryForFileContentSearch,
148148
Settings.IndexSearchExcludedSubdirectoryPaths,
149149
query,
@@ -181,7 +181,7 @@ private async Task<List<Result>> WindowsIndexFilesAndFoldersSearchAsync(Query qu
181181

182182
return await IndexSearch.WindowsIndexSearchAsync(
183183
querySearchString,
184-
queryConstructor.CreateQueryHelper(),
184+
queryConstructor.CreateQueryHelper,
185185
queryConstructor.QueryForAllFilesAndFolders,
186186
Settings.IndexSearchExcludedSubdirectoryPaths,
187187
query,
@@ -195,7 +195,7 @@ private async Task<List<Result>> WindowsIndexTopLevelFolderSearchAsync(Query que
195195

196196
return await IndexSearch.WindowsIndexSearchAsync(
197197
path,
198-
queryConstructor.CreateQueryHelper(),
198+
queryConstructor.CreateQueryHelper,
199199
queryConstructor.QueryForTopLevelDirectorySearch,
200200
Settings.IndexSearchExcludedSubdirectoryPaths,
201201
query,

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ internal static async Task<List<Result>> ExecuteWindowsIndexSearchAsync(string i
8888

8989
internal async static Task<List<Result>> WindowsIndexSearchAsync(
9090
string searchString,
91-
CSearchQueryHelper queryHelper,
91+
Func<CSearchQueryHelper> createQueryHelper,
9292
Func<string, string> constructQuery,
9393
List<AccessLink> exclusionList,
9494
Query query,
@@ -104,7 +104,7 @@ internal async static Task<List<Result>> WindowsIndexSearchAsync(
104104
var constructedQuery = constructQuery(searchString);
105105

106106
return RemoveResultsInExclusionList(
107-
await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper.ConnectionString, query, token).ConfigureAwait(false),
107+
await ExecuteWindowsIndexSearchAsync(constructedQuery, createQueryHelper().ConnectionString, query, token).ConfigureAwait(false),
108108
exclusionList,
109109
token);
110110
}

0 commit comments

Comments
 (0)