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:
parent
b25335acbd
commit
1c9b2572ae
23 changed files with 613 additions and 17 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue