mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Moved the update check code from the External azure service into Ombi at /api/v1/update/BRANCH
This commit is contained in:
parent
1e1ec436af
commit
498c019f5d
11 changed files with 516 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Net.Http;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ombi.Api
|
||||
|
@ -6,5 +7,6 @@ namespace Ombi.Api
|
|||
public interface IOmbiHttpClient
|
||||
{
|
||||
Task<HttpResponseMessage> SendAsync(HttpRequestMessage request);
|
||||
Task<string> GetStringAsync(Uri requestUri);
|
||||
}
|
||||
}
|
|
@ -56,6 +56,18 @@ namespace Ombi.Api
|
|||
|
||||
|
||||
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
|
||||
{
|
||||
await Setup();
|
||||
return await _client.SendAsync(request);
|
||||
}
|
||||
|
||||
public async Task<string> GetStringAsync(Uri requestUri)
|
||||
{
|
||||
await Setup();
|
||||
return await _client.GetStringAsync(requestUri);
|
||||
}
|
||||
|
||||
private async Task Setup()
|
||||
{
|
||||
if (_client == null)
|
||||
{
|
||||
|
@ -66,8 +78,6 @@ namespace Ombi.Api
|
|||
}
|
||||
_client = new HttpClient(_handler);
|
||||
}
|
||||
|
||||
return await _client.SendAsync(request);
|
||||
}
|
||||
|
||||
private async Task<HttpMessageHandler> GetHandler()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue