Skip to content

Commit

Permalink
Refactor code to ensure successful compilation in publish mode
Browse files Browse the repository at this point in the history
- Changed the type of CollectIntervalManager from an interface to a concrete class in ASFFreeGamesPlugin.
- Suppressed specific warnings in GetIPCommand to prevent compilation issues related to asynchronous calls and code analysis rules.
  • Loading branch information
maxisoft committed May 4, 2024
1 parent b437015 commit a367e4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ASFFreeGames/ASFFreeGamesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal static PluginContext Context {
public ASFFreeGamesOptions Options => OptionsField;
private ASFFreeGamesOptions OptionsField = new();

private readonly ICollectIntervalManager CollectIntervalManager;
private readonly CollectIntervalManager CollectIntervalManager;

public ASFFreeGamesPlugin() {
CommandDispatcher = new CommandDispatcher(Options);
Expand Down
4 changes: 4 additions & 0 deletions ASFFreeGames/Commands/GetIp/GetIPCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ internal sealed class GetIPCommand : IBotCommand {
}

try {
#pragma warning disable CAC001
#pragma warning disable CA2007
await using StreamResponse? result = await web.UrlGetToStream(new Uri(GetIPAddressUrl), cancellationToken: cancellationToken).ConfigureAwait(false);
#pragma warning restore CA2007
#pragma warning restore CAC001

if (result?.Content is null) { return null; }

Expand Down

0 comments on commit a367e4d

Please sign in to comment.