Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo 2024-08-20 19:09:30 -05:00 committed by GitHub
parent 7ca523adef
commit 38fc8e9110
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
103 changed files with 1643 additions and 1079 deletions

View file

@ -3,6 +3,7 @@ using System.Threading;
using System.Threading.Tasks;
using API.Data;
using API.Services.Tasks.Scanner;
using Hangfire;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -45,7 +46,8 @@ public class StartupTasksHostedService : IHostedService
if ((await unitOfWork.SettingsRepository.GetSettingsDtoAsync()).EnableFolderWatching)
{
var libraryWatcher = scope.ServiceProvider.GetRequiredService<ILibraryWatcher>();
await libraryWatcher.StartWatching();
// Push this off for a bit for people with massive libraries, as it can take up to 45 mins and blocks the thread
BackgroundJob.Enqueue(() => libraryWatcher.StartWatching());
}
}
catch (Exception)