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 5d1b3bd commit eec9c75
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 @@ -76,6 +76,7 @@ await _fileRestClient.Received(1).GetFileAsync(owner,
repositoryName,
filePath,
Arg.Is<GetFileRequest>(x =>
x.ReferenceName == referenceName));
x.ReferenceName == referenceName),
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.File.GetRepositoryFile.Context;
using Mohaymen.GiteaClient.Gitea.File.GetRepositoryFile.Dtos;
Expand All @@ -13,5 +14,6 @@ Task<ApiResponse<GetFileResponseDto>> GetFileAsync(
[AliasAs("owner")] string owner,
[AliasAs("repo")] string repositoryName,
[AliasAs("filepath")] string filePath,
[Body] GetFileRequest getFileRequest);
[Body] GetFileRequest getFileRequest,
CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task<ApiResponse<GetFileResponseDto>> Handle(GetFileCommand command
_validator.ValidateAndThrow(command);
var createBranchRequest = command.ToGetRepositoryFileRequest();
var owner = _options.Value.RepositoriesOwner;
return await _fileRestClient.GetFileAsync(owner, command.RepositoryName, command.FilePath, createBranchRequest)
return await _fileRestClient.GetFileAsync(owner, command.RepositoryName, command.FilePath, createBranchRequest, cancellationToken)
.ConfigureAwait(false);
}
}
Expand Down

0 comments on commit eec9c75

Please sign in to comment.