Merge branch 'master' into patch-2

This commit is contained in:
Astrid
2019-10-18 13:37:09 +02:00
committed by GitHub
51 changed files with 2838 additions and 1518 deletions

View File

@@ -48,9 +48,9 @@ namespace PluralKit.API.Controllers
[HttpGet]
[RequiresSystem]
public async Task<ActionResult<PKSystem>> GetOwnSystem()
public Task<ActionResult<PKSystem>> GetOwnSystem()
{
return Ok(_auth.CurrentSystem);
return Task.FromResult<ActionResult<PKSystem>>(Ok(_auth.CurrentSystem));
}
[HttpGet("{hid}")]

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Builder;
using App.Metrics;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
@@ -28,12 +29,16 @@ namespace PluralKit.API
.AddTransient<MemberStore>()
.AddTransient<SwitchStore>()
.AddTransient<MessageStore>()
.AddSingleton(svc => InitUtils.InitMetrics(svc.GetRequiredService<CoreConfig>(), "API"))
.AddScoped<TokenAuthService>()
.AddTransient(_ => Configuration.GetSection("PluralKit").Get<CoreConfig>() ?? new CoreConfig())
.AddSingleton(svc => InitUtils.InitLogger(svc.GetRequiredService<CoreConfig>(), "api"))
.AddSingleton(svc => new DbConnectionFactory(svc.GetRequiredService<CoreConfig>().Database));
.AddTransient<DbConnectionCountHolder>()
.AddTransient<DbConnectionFactory>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.