Lots of Hangfire attempts to solve the lock issue. Not sure how to fix it. Added some APIs for streams.
This commit is contained in:
parent
bb0a59448f
commit
fad4ca4414
10 changed files with 89 additions and 28 deletions
|
|
@ -21,11 +21,11 @@ namespace API.Services
|
|||
private readonly ICleanupService _cleanupService;
|
||||
private readonly IDirectoryService _directoryService;
|
||||
|
||||
public static BackgroundJobServer Client => new BackgroundJobServer();
|
||||
// new BackgroundJobServerOptions()
|
||||
// {
|
||||
// WorkerCount = 1
|
||||
// }
|
||||
public static BackgroundJobServer Client => new BackgroundJobServer(new BackgroundJobServerOptions()
|
||||
{
|
||||
WorkerCount = 1
|
||||
});
|
||||
|
||||
|
||||
public TaskScheduler(ICacheService cacheService, ILogger<TaskScheduler> logger, IScannerService scannerService,
|
||||
IUnitOfWork unitOfWork, IMetadataService metadataService, IBackupService backupService, ICleanupService cleanupService,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace API.Services.Tasks
|
|||
_metadataService = metadataService;
|
||||
}
|
||||
|
||||
[DisableConcurrentExecution(timeoutInSeconds: 5)]
|
||||
//[DisableConcurrentExecution(timeoutInSeconds: 5)]
|
||||
[AutomaticRetry(Attempts = 0, LogEvents = false, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
|
||||
public void ScanLibraries()
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ namespace API.Services.Tasks
|
|||
_scannedSeries = null;
|
||||
}
|
||||
|
||||
[DisableConcurrentExecution(5)]
|
||||
//[DisableConcurrentExecution(5)]
|
||||
[AutomaticRetry(Attempts = 0, LogEvents = false, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
|
||||
public void ScanLibrary(int libraryId, bool forceUpdate)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,14 +18,13 @@ namespace API.Services
|
|||
_provider = provider;
|
||||
}
|
||||
|
||||
public Task ExecuteAsync(CancellationToken cancellationToken)
|
||||
public Task ExecuteAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
using (var scope = _provider.CreateScope())
|
||||
using var scope = _provider.CreateScope();
|
||||
foreach (var singleton in GetServices(_services))
|
||||
{
|
||||
foreach (var singleton in GetServices(_services))
|
||||
{
|
||||
scope.ServiceProvider.GetServices(singleton);
|
||||
}
|
||||
Console.WriteLine("DI preloading of " + singleton.FullName);
|
||||
scope.ServiceProvider.GetServices(singleton);
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue