KavitaStats Cleanup (#695)
* Refactored Stats code to be much cleaner and user better naming. * Cleaned up the actual http code to use Flurl and to return if the upload was successful or not so we can delete the file where appropriate. * More refactoring for the stats code to clean it up and keep it consistent with our standards. * Removed a confusing log statement * Added support for old api key header from original stat server * Use the correct endpoint, not the new one. * Code smell
This commit is contained in:
parent
69f44444f3
commit
88214c5c6b
8 changed files with 106 additions and 167 deletions
|
@ -89,7 +89,7 @@ namespace API.Services
|
|||
}
|
||||
|
||||
_logger.LogDebug("Scheduling stat collection daily");
|
||||
RecurringJob.AddOrUpdate(SendDataTask, () => _statsService.CollectAndSendStatsData(), Cron.Daily, TimeZoneInfo.Local);
|
||||
RecurringJob.AddOrUpdate(SendDataTask, () => _statsService.Send(), Cron.Daily, TimeZoneInfo.Local);
|
||||
}
|
||||
|
||||
public void CancelStatsTasks()
|
||||
|
@ -102,7 +102,7 @@ namespace API.Services
|
|||
public void RunStatCollection()
|
||||
{
|
||||
_logger.LogInformation("Enqueuing stat collection");
|
||||
BackgroundJob.Enqueue(() => _statsService.CollectAndSendStatsData());
|
||||
BackgroundJob.Enqueue(() => _statsService.Send());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue