Skip to content

Commit 42f7137

Browse files
committed
Revert "feat: The OSS update to the start function adds pre - and post-processing custom function injections"
This reverts commit 4bb0969.
1 parent 4bb0969 commit 42f7137

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

src/c#/GeneralUpdate.Common/Shared/Object/GlobalConfigInfoOSS.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ public class GlobalConfigInfoOSS
2020
[JsonPropertyName("Encoding")]
2121
public string Encoding { get; set; }
2222

23-
[JsonPropertyName("Extend")]
24-
public string Extend { get; set; }
25-
26-
[JsonPropertyName("Extend2")]
27-
public string Extend2 { get; set; }
28-
2923
public GlobalConfigInfoOSS()
3024
{
3125
}

src/c#/GeneralUpdate.Core/GeneralUpdateOSS.cs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,15 @@ namespace GeneralUpdate.Core
1111
{
1212
public sealed class GeneralUpdateOSS
1313
{
14-
private static Func<string, bool>? _beforeFunc;
15-
private static Action<string>? _afterFunc;
16-
1714
private GeneralUpdateOSS() { }
1815

1916
#region Public Methods
2017

21-
/// <summary>
22-
/// Starting an OSS update for windows,Linux,mac platform.
23-
/// </summary>
24-
/// <param name="beforeFunc">Inject a custom pre-processing method, which will be executed before updating. whose parameters use the Extend.</param>
25-
/// <param name="afterFunc">Injects a post-processing method whose parameters use the Extend2</param>
26-
public static async Task Start(Func<string, bool> beforeFunc, Action<string> afterFunc)
27-
{
28-
_beforeFunc = beforeFunc;
29-
_afterFunc = afterFunc;
30-
await BaseStart();
31-
}
32-
3318
/// <summary>
3419
/// Starting an OSS update for windows,Linux,mac platform.
3520
/// </summary>
3621
/// <returns></returns>
37-
public static async Task Start() => await BaseStart();
22+
public static async Task Start()=> await BaseStart();
3823

3924
#endregion Public Methods
4025

@@ -52,17 +37,9 @@ private static async Task BaseStart()
5237
return;
5338

5439
var parameter = JsonSerializer.Deserialize<GlobalConfigInfoOSS>(json, GlobalConfigInfoOSSJsonContext.Default.GlobalConfigInfoOSS);
55-
var result = _beforeFunc?.Invoke(parameter?.Extend);
56-
if (_beforeFunc is not null)
57-
{
58-
if (result == false)
59-
return;
60-
}
61-
6240
var strategy = new OSSStrategy();
6341
strategy.Create(parameter);
6442
await strategy.ExecuteAsync();
65-
_afterFunc?.Invoke(parameter?.Extend2);
6643
}
6744
catch (Exception exception)
6845
{

0 commit comments

Comments
 (0)