Feat/usage stats collection (#317)

* feat: implement anonymous usage data collection

Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
Leonardo Dias 2021-06-20 19:26:35 -03:00 committed by GitHub
parent b25335acbd
commit 1c9b2572ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 613 additions and 17 deletions

View file

@ -2,9 +2,9 @@ using System;
using System.IO.Compression;
using System.Linq;
using API.Extensions;
using API.Interfaces;
using API.Middleware;
using API.Services;
using API.Services.HostedServices;
using Hangfire;
using Hangfire.MemoryStorage;
using Kavita.Common.EnvironmentInfo;
@ -64,6 +64,8 @@ namespace API
services.AddResponseCaching();
services.AddStatsClient(_config);
services.AddHangfire(configuration => configuration
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
@ -71,11 +73,15 @@ namespace API
// Add the processing server as IHostedService
services.AddHangfireServer();
// Add IHostedService for startup tasks
// Any services that should be bootstrapped go here
services.AddHostedService<StartupTasksHostedService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IBackgroundJobClient backgroundJobs, IWebHostEnvironment env,
IHostApplicationLifetime applicationLifetime, ITaskScheduler taskScheduler)
IHostApplicationLifetime applicationLifetime)
{
app.UseMiddleware<ExceptionMiddleware>();
@ -137,9 +143,6 @@ namespace API
{
Console.WriteLine($"Kavita - v{BuildInfo.Version}");
});
// Any services that should be bootstrapped go here
taskScheduler.ScheduleTasks();
}
private void OnShutdown()