mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Add response caching to metrics
This commit is contained in:
parent
f8db7d4386
commit
46ee87553c
@ -108,6 +108,7 @@ public class MetricsController : ControllerBase
|
||||
|
||||
[HttpGet]
|
||||
[Route("report")]
|
||||
[ResponseCache(Duration = 60 * 60 * 4, VaryByQueryKeys = new [] {"action", "from", "to"})]
|
||||
public async Task GetReport([FromQuery] string action, [FromQuery] string from, [FromQuery] string? to)
|
||||
{
|
||||
var parser = new Parser();
|
||||
|
@ -63,6 +63,7 @@ public class Startup
|
||||
services.AddSingleton<AuthorFiles>();
|
||||
services.AddSingleton<AuthorKeys>();
|
||||
services.AddSingleton<Client>();
|
||||
services.AddResponseCaching();
|
||||
services.AddSingleton(s =>
|
||||
{
|
||||
var settings = s.GetService<AppSettings>()!;
|
||||
@ -109,6 +110,8 @@ public class Startup
|
||||
app.UseService<DiscordWebHook>();
|
||||
app.UseService<Watchdog>();
|
||||
|
||||
app.UseResponseCaching();
|
||||
|
||||
app.Use(next =>
|
||||
{
|
||||
return async context =>
|
||||
|
Loading…
Reference in New Issue
Block a user