Skip to content

Commit

Permalink
Fix async signature (#334)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Incorrect controller route/method signature causing build error

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
```
D:\a\chat-copilot\chat-copilot\webapi\Controllers\MaintenanceController.cs(50,55): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [D:\a\chat-copilot\chat-copilot\webapi\CopilotChatWebApi.csproj]
```
### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
  • Loading branch information
crickman committed Sep 12, 2023
1 parent 14af669 commit b1beca8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions webapi/Controllers/MaintenanceController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Threading;
using System.Threading.Tasks;
using CopilotChat.WebApi.Auth;
using CopilotChat.WebApi.Hubs;
using CopilotChat.WebApi.Models.Response;
Expand Down Expand Up @@ -47,7 +46,7 @@ public class MaintenanceController : ControllerBase
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<MigrationResult?>> GetMaintenanceStatusAsync(
public ActionResult<MigrationResult?> GetMaintenanceStatus(
[FromServices] IKernel kernel,
[FromServices] IHubContext<MessageRelayHub> messageRelayHubContext,
CancellationToken cancellationToken = default)
Expand Down

0 comments on commit b1beca8

Please sign in to comment.