Skip to content

Commit b9c0eb7

Browse files
committed
Code quality
1 parent e2d9148 commit b9c0eb7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using Flow.Launcher.Infrastructure.Logger;
2-
using Flow.Launcher.Plugin;
3-
using System;
1+
using System;
42
using System.Collections.Generic;
53
using System.Threading;
64
using System.Threading.Tasks;
5+
using CommunityToolkit.Mvvm.DependencyInjection;
6+
using Flow.Launcher.Plugin;
77

88
namespace Flow.Launcher.Core.ExternalPlugins
99
{
@@ -18,11 +18,11 @@ public static class PluginsManifest
1818
private static readonly SemaphoreSlim manifestUpdateLock = new(1);
1919

2020
private static DateTime lastFetchedAt = DateTime.MinValue;
21-
private static TimeSpan fetchTimeout = TimeSpan.FromMinutes(2);
21+
private static readonly TimeSpan fetchTimeout = TimeSpan.FromMinutes(2);
2222

2323
public static List<UserPlugin> UserPlugins { get; private set; }
2424

25-
public static async Task<bool> UpdateManifestAsync(CancellationToken token = default, bool usePrimaryUrlOnly = false)
25+
public static async Task<bool> UpdateManifestAsync(bool usePrimaryUrlOnly = false, CancellationToken token = default)
2626
{
2727
try
2828
{
@@ -44,7 +44,7 @@ public static async Task<bool> UpdateManifestAsync(CancellationToken token = def
4444
}
4545
catch (Exception e)
4646
{
47-
Log.Exception($"|PluginsManifest.{nameof(UpdateManifestAsync)}|Http request failed", e);
47+
Ioc.Default.GetRequiredService<IPublicAPI>().LogException(nameof(PluginsManifest), "Http request failed", e);
4848
}
4949
finally
5050
{

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ await Context.API.ShowProgressBoxAsync(prgBoxTitle,
236236
internal async ValueTask<List<Result>> RequestUpdateAsync(string search, CancellationToken token,
237237
bool usePrimaryUrlOnly = false)
238238
{
239-
await PluginsManifest.UpdateManifestAsync(token, usePrimaryUrlOnly);
239+
await PluginsManifest.UpdateManifestAsync(usePrimaryUrlOnly, token);
240240

241241
var pluginFromLocalPath = null as UserPlugin;
242242
var updateFromLocalPath = false;
@@ -601,7 +601,7 @@ private bool InstallSourceKnown(string url)
601601
internal async ValueTask<List<Result>> RequestInstallOrUpdateAsync(string search, CancellationToken token,
602602
bool usePrimaryUrlOnly = false)
603603
{
604-
await PluginsManifest.UpdateManifestAsync(token, usePrimaryUrlOnly);
604+
await PluginsManifest.UpdateManifestAsync(usePrimaryUrlOnly, token);
605605

606606
if (Uri.IsWellFormedUriString(search, UriKind.Absolute)
607607
&& search.Split('.').Last() == ZipSuffix)

0 commit comments

Comments
 (0)