Skip to content

Commit

Permalink
Merge pull request #789 from Cysharp/feature/FixWarnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
mayuki authored Jun 17, 2024
2 parents b96835e + 7758c0d commit 6407f91
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion perf/BenchmarkApp/PerformanceTest.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async Task Main(
// Create a control channel
using var channelControl = GrpcChannel.ForAddress(config.Url);
var controlServiceClient = MagicOnionClient.Create<IPerfTestControlService>(channelControl);
controlServiceClient.SetMemoryProfilerCollectAllocations(true);
await controlServiceClient.SetMemoryProfilerCollectAllocationsAsync(true);

ServerInformation serverInfo;
WriteLog("Gathering the server information...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public UnaryResult<ServerInformation> GetServerInformationAsync()
ApplicationInformation.Current.IsAttached));
}

public UnaryResult SetMemoryProfilerCollectAllocations(bool enable)
public UnaryResult SetMemoryProfilerCollectAllocationsAsync(bool enable)
{
MemoryProfiler.CollectAllocations(enable);
return UnaryResult.CompletedResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface IPerfTestControlService : IService<IPerfTestControlService>
{
UnaryResult<ServerInformation> GetServerInformationAsync();

UnaryResult SetMemoryProfilerCollectAllocations(bool enable);
UnaryResult SetMemoryProfilerCollectAllocationsAsync(bool enable);
UnaryResult CreateMemoryProfilerSnapshotAsync(string name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ public HubMethodBenchmarks()
}

[Benchmark]
public async Task Void_Parameter_Zero_NoReturn()
public Task Void_Parameter_Zero_NoReturn()
{
client.Void_Parameter_Zero_NoReturn();
return Task.CompletedTask;
}

[Benchmark]
Expand Down
1 change: 1 addition & 0 deletions samples/ChatApp/ChatApp.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void OnSendMessage(MessageResponse message)
public async Task<string> HelloAsync(string name, int age)
{
Console.WriteLine("HelloAsync called");
await Task.Delay(100);
return $"Hello {name} ({age})!; {sessionId}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ Schemas.Parameter[] BuildParameters(IDictionary<string, Schema> definitions, Xml
{
BuildSchema(definitions, x.ParameterType);
refSchema = new Schema { @ref = BuildSchema(definitions, x.ParameterType) };
#pragma warning disable SYSLIB0050
var unknownObj = System.Runtime.Serialization.FormatterServices.GetUninitializedObject(x.ParameterType);
#pragma warning restore SYSLIB0050
defaultObjectExample = JsonConvert.SerializeObject(unknownObj, new[] { new Newtonsoft.Json.Converters.StringEnumConverter() });
swaggerDataType = "string"; // object can not attach formData.
}
Expand Down Expand Up @@ -488,4 +490,4 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ

return property;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace MagicOnion.Integration.Tests;

public class StreamingHubClientResultTest(MagicOnionApplicationFactory<StreamingHubClientResultTestHub> factory, ITestOutputHelper testOutputHelper) : IClassFixture<MagicOnionApplicationFactory<StreamingHubClientResultTestHub>>
public class StreamingHubClientResultTest(MagicOnionApplicationFactory<StreamingHubClientResultTestHub> factory) : IClassFixture<MagicOnionApplicationFactory<StreamingHubClientResultTestHub>>
{
readonly MagicOnionApplicationFactory<StreamingHubClientResultTestHub> factory = factory;

Expand Down

0 comments on commit 6407f91

Please sign in to comment.