@@ -11,30 +11,15 @@ namespace GeneralUpdate.Core
11
11
{
12
12
public sealed class GeneralUpdateOSS
13
13
{
14
- private static Func < string , bool > ? _beforeFunc ;
15
- private static Action < string > ? _afterFunc ;
16
-
17
14
private GeneralUpdateOSS ( ) { }
18
15
19
16
#region Public Methods
20
17
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
-
33
18
/// <summary>
34
19
/// Starting an OSS update for windows,Linux,mac platform.
35
20
/// </summary>
36
21
/// <returns></returns>
37
- public static async Task Start ( ) => await BaseStart ( ) ;
22
+ public static async Task Start ( ) => await BaseStart ( ) ;
38
23
39
24
#endregion Public Methods
40
25
@@ -52,17 +37,9 @@ private static async Task BaseStart()
52
37
return ;
53
38
54
39
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
-
62
40
var strategy = new OSSStrategy ( ) ;
63
41
strategy . Create ( parameter ) ;
64
42
await strategy . ExecuteAsync ( ) ;
65
- _afterFunc ? . Invoke ( parameter ? . Extend2 ) ;
66
43
}
67
44
catch ( Exception exception )
68
45
{
0 commit comments