Skip to content

Commit

Permalink
chore: add cancellation token
Browse files Browse the repository at this point in the history
  • Loading branch information
HamedSY committed Jul 25, 2024
1 parent 1b6023b commit c09771e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ await _pullRequestRestClient.Received(1).CreatePullRequestAsync(owner,
&& x.Body == body
&& x.Title == title
&& x.Assignee == assignee
&& x.Assignees!.SequenceEqual(assignees)));
&& x.Assignees!.SequenceEqual(assignees)),
default);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Threading;
using System.Threading.Tasks;
using Mohaymen.GiteaClient.Core.ApiCall.Abstractions;
using Mohaymen.GiteaClient.Gitea.PullRequest.CreatePullRequest.Context;
using Mohaymen.GiteaClient.Gitea.PullRequest.CreatePullRequest.Dtos;
Expand All @@ -12,5 +13,6 @@ internal interface IPullRequestRestClient : IRefitClientInterface
Task<ApiResponse<CreatePullRequestResponseDto>> CreatePullRequestAsync(
[AliasAs("owner")] string owner,
[AliasAs("repo")] string repositoryName,
[Body] CreatePullRequestRequest createPullRequestRequest);
[Body] CreatePullRequestRequest createPullRequestRequest,
CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<ApiResponse<CreatePullRequestResponseDto>> Handle(CreatePullRe
_validator.ValidateAndThrow(command);
var createPullRequestRequest = command.ToCreatePullRequestRequest();
var owner = _options.Value.RepositoriesOwner;
return await _pullRequestRestClient.CreatePullRequestAsync(owner, command.RepositoryName, createPullRequestRequest)
return await _pullRequestRestClient.CreatePullRequestAsync(owner, command.RepositoryName, createPullRequestRequest, cancellationToken)
.ConfigureAwait(false);
}
}

0 comments on commit c09771e

Please sign in to comment.