mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix GitHubClient config
This commit is contained in:
parent
5dfe568144
commit
aef399ef2d
2 changed files with 11 additions and 3 deletions
|
|
@ -28,10 +28,10 @@ public static void RegisterAgentServices(this IServiceCollection services)
|
|||
services.AddSingleton<IFilterListsApiClient, FilterListsApiClient>();
|
||||
services.AddSingleton<IGitHubClient>(s =>
|
||||
{
|
||||
var gitHubConfig = s.GetService<GitHub>();
|
||||
var client = new GitHubClient(new ProductHeaderValue(gitHubConfig.ProductHeaderValue))
|
||||
var gitHubConfig = s.GetService<IOptions<GitHub>>();
|
||||
var client = new GitHubClient(new ProductHeaderValue(gitHubConfig.Value.ProductHeaderValue))
|
||||
{
|
||||
Credentials = new Credentials(gitHubConfig.OauthToken)
|
||||
Credentials = new Credentials(gitHubConfig.Value.OauthToken)
|
||||
};
|
||||
return client;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using FilterLists.Agent.Features.Urls.Models.ValidationResults;
|
||||
using MediatR;
|
||||
using Octokit;
|
||||
|
||||
namespace FilterLists.Agent.Features.Urls
|
||||
{
|
||||
|
|
@ -21,6 +22,13 @@ public Command(IEnumerable<DataFileUrlValidationResults> dataFileUrlValidationRe
|
|||
|
||||
public class Handler : AsyncRequestHandler<Command>
|
||||
{
|
||||
private readonly IGitHubClient _gitHubClient;
|
||||
|
||||
public Handler(IGitHubClient gitHubClient)
|
||||
{
|
||||
_gitHubClient = gitHubClient;
|
||||
}
|
||||
|
||||
protected override async Task Handle(Command request, CancellationToken cancellationToken)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
|
|
|||
Loading…
Reference in a new issue