Skip to content

Commit cbaf76f

Browse files
committed
Add test codes
1 parent 76dfe38 commit cbaf76f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading;
88
using System.Threading.Tasks;
99
using CommunityToolkit.Mvvm.DependencyInjection;
10+
using Droplex;
1011
using Flow.Launcher.Core.ExternalPlugins;
1112
using Flow.Launcher.Infrastructure;
1213
using Flow.Launcher.Infrastructure.UserSettings;
@@ -276,27 +277,44 @@ public static ICollection<PluginPair> ValidPluginsForQuery(Query query)
276277

277278
public static async Task<List<Result>> QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token)
278279
{
280+
API.LogDebug(ClassName, $"a");
281+
279282
var results = new List<Result>();
280283
var metadata = pair.Metadata;
281284

282285
try
283286
{
287+
API.LogDebug(ClassName, $"b");
288+
284289
var milliseconds = await API.StopwatchLogDebugAsync(ClassName, $"Cost for {metadata.Name}",
285290
async () => results = await pair.Plugin.QueryAsync(query, token).ConfigureAwait(false));
286291

292+
API.LogDebug(ClassName, $"c");
293+
287294
token.ThrowIfCancellationRequested();
295+
296+
API.LogDebug(ClassName, $"d");
297+
288298
if (results == null)
289299
return null;
300+
301+
API.LogDebug(ClassName, $"e");
302+
290303
UpdatePluginMetadata(results, metadata, query);
291304

305+
API.LogDebug(ClassName, $"f");
306+
292307
metadata.QueryCount += 1;
293308
metadata.AvgQueryTime =
294309
metadata.QueryCount == 1 ? milliseconds : (metadata.AvgQueryTime + milliseconds) / 2;
295310
token.ThrowIfCancellationRequested();
311+
312+
API.LogDebug(ClassName, $"g");
296313
}
297314
catch (OperationCanceledException)
298315
{
299316
// null will be fine since the results will only be added into queue if the token hasn't been cancelled
317+
API.LogDebug(ClassName, $"h");
300318
return null;
301319
}
302320
catch (Exception e)

0 commit comments

Comments
 (0)